Commit 25ce4be7 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Bjorn Helgaas

genirq: Return the IRQ name from free_irq()

This allows callers to get back at them instead of having to store it in
another variable.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent a7e60e55
...@@ -155,7 +155,7 @@ extern int __must_check ...@@ -155,7 +155,7 @@ extern int __must_check
request_percpu_irq(unsigned int irq, irq_handler_t handler, request_percpu_irq(unsigned int irq, irq_handler_t handler,
const char *devname, void __percpu *percpu_dev_id); 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 *); extern void free_percpu_irq(unsigned int, void __percpu *);
struct device; struct device;
......
...@@ -1574,20 +1574,27 @@ EXPORT_SYMBOL_GPL(remove_irq); ...@@ -1574,20 +1574,27 @@ EXPORT_SYMBOL_GPL(remove_irq);
* have completed. * have completed.
* *
* This function must not be called from interrupt context. * 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 irq_desc *desc = irq_to_desc(irq);
struct irqaction *action;
const char *devname;
if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc))) if (!desc || WARN_ON(irq_settings_is_per_cpu_devid(desc)))
return; return NULL;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
if (WARN_ON(desc->affinity_notify)) if (WARN_ON(desc->affinity_notify))
desc->affinity_notify = NULL; desc->affinity_notify = NULL;
#endif #endif
kfree(__free_irq(irq, dev_id)); action = __free_irq(irq, dev_id);
devname = action->name;
kfree(action);
return devname;
} }
EXPORT_SYMBOL(free_irq); EXPORT_SYMBOL(free_irq);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment