]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
genirq: Return the IRQ name from free_irq()
authorChristoph Hellwig <hch@lst.de>
Thu, 13 Apr 2017 07:06:41 +0000 (09:06 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 18 Apr 2017 18:40:00 +0000 (13:40 -0500)
This allows callers to get back at them instead of having to store it in
another variable.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
include/linux/interrupt.h
kernel/irq/manage.c

index 53144e78a3691d2d0ea46b48319c5af337f0fda2..a6fba4804672858b87430b81c0af52378bd7ed89 100644 (file)
@@ -155,7 +155,7 @@ extern int __must_check
 request_percpu_irq(unsigned int irq, irq_handler_t handler,
                   const char *devname, void __percpu *percpu_dev_id);
 
-extern void free_irq(unsigned int, void *);
+extern const void *free_irq(unsigned int, void *);
 extern void free_percpu_irq(unsigned int, void __percpu *);
 
 struct device;
index 391cb738b2db6e3f2d31eefe64d33edae9d06bda..e688e7e067727bd509cf662c6c249cf885010f34 100644 (file)
@@ -1574,20 +1574,27 @@ EXPORT_SYMBOL_GPL(remove_irq);
  *     have completed.
  *
  *     This function must not be called from interrupt context.
+ *
+ *     Returns the devname argument passed to request_irq.
  */
-void free_irq(unsigned int irq, void *dev_id)
+const void *free_irq(unsigned int irq, void *dev_id)
 {
        struct irq_desc *desc = irq_to_desc(irq);
+       struct irqaction *action;
+       const char *devname;
 
        if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc)))
-               return;
+               return NULL;
 
 #ifdef CONFIG_SMP
        if (WARN_ON(desc->affinity_notify))
                desc->affinity_notify = NULL;
 #endif
 
-       kfree(__free_irq(irq, dev_id));
+       action = __free_irq(irq, dev_id);
+       devname = action->name;
+       kfree(action);
+       return devname;
 }
 EXPORT_SYMBOL(free_irq);