diff options
author | Heiner Kallweit <hkallweit1@gmail.com> | 2017-02-12 10:31:44 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2017-02-12 13:49:25 -0500 |
commit | 899b5fbf9d3fcb721690b4d58cf58cc018517003 (patch) | |
tree | bee7de44cc00633d1a5da4943adf43cad2e4de56 | |
parent | f435da416beaacc8934fc21820d9488269b39c98 (diff) |
genirq/devres: Use dev_name(dev) as default for devname
Allow the devname parameter to be NULL and use dev_name(dev) in this case.
This should be an appropriate default for most use cases.
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: http://lkml.kernel.org/r/05c63d67-30b4-7026-02d5-ce7fb7bc185f@gmail.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | kernel/irq/devres.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/irq/devres.c b/kernel/irq/devres.c index 18babef39361..1613bfd48365 100644 --- a/kernel/irq/devres.c +++ b/kernel/irq/devres.c | |||
@@ -34,7 +34,7 @@ static int devm_irq_match(struct device *dev, void *res, void *data) | |||
34 | * @thread_fn: function to be called in a threaded interrupt context. NULL | 34 | * @thread_fn: function to be called in a threaded interrupt context. NULL |
35 | * for devices which handle everything in @handler | 35 | * for devices which handle everything in @handler |
36 | * @irqflags: Interrupt type flags | 36 | * @irqflags: Interrupt type flags |
37 | * @devname: An ascii name for the claiming device | 37 | * @devname: An ascii name for the claiming device, dev_name(dev) if NULL |
38 | * @dev_id: A cookie passed back to the handler function | 38 | * @dev_id: A cookie passed back to the handler function |
39 | * | 39 | * |
40 | * Except for the extra @dev argument, this function takes the | 40 | * Except for the extra @dev argument, this function takes the |
@@ -58,6 +58,9 @@ int devm_request_threaded_irq(struct device *dev, unsigned int irq, | |||
58 | if (!dr) | 58 | if (!dr) |
59 | return -ENOMEM; | 59 | return -ENOMEM; |
60 | 60 | ||
61 | if (!devname) | ||
62 | devname = dev_name(dev); | ||
63 | |||
61 | rc = request_threaded_irq(irq, handler, thread_fn, irqflags, devname, | 64 | rc = request_threaded_irq(irq, handler, thread_fn, irqflags, devname, |
62 | dev_id); | 65 | dev_id); |
63 | if (rc) { | 66 | if (rc) { |
@@ -81,7 +84,7 @@ EXPORT_SYMBOL(devm_request_threaded_irq); | |||
81 | * @thread_fn: function to be called in a threaded interrupt context. NULL | 84 | * @thread_fn: function to be called in a threaded interrupt context. NULL |
82 | * for devices which handle everything in @handler | 85 | * for devices which handle everything in @handler |
83 | * @irqflags: Interrupt type flags | 86 | * @irqflags: Interrupt type flags |
84 | * @devname: An ascii name for the claiming device | 87 | * @devname: An ascii name for the claiming device, dev_name(dev) if NULL |
85 | * @dev_id: A cookie passed back to the handler function | 88 | * @dev_id: A cookie passed back to the handler function |
86 | * | 89 | * |
87 | * Except for the extra @dev argument, this function takes the | 90 | * Except for the extra @dev argument, this function takes the |
@@ -104,6 +107,9 @@ int devm_request_any_context_irq(struct device *dev, unsigned int irq, | |||
104 | if (!dr) | 107 | if (!dr) |
105 | return -ENOMEM; | 108 | return -ENOMEM; |
106 | 109 | ||
110 | if (!devname) | ||
111 | devname = dev_name(dev); | ||
112 | |||
107 | rc = request_any_context_irq(irq, handler, irqflags, devname, dev_id); | 113 | rc = request_any_context_irq(irq, handler, irqflags, devname, dev_id); |
108 | if (rc < 0) { | 114 | if (rc < 0) { |
109 | devres_free(dr); | 115 | devres_free(dr); |