[PATCH 1/2] genirq: error reporting in request_percpu_irq() and request_threaded_irq()
From: Vinayak Kale
Date: Wed Nov 06 2013 - 07:08:30 EST
Return a separate error code when invalid interrupt type is passed to
request_percpu_irq() and request_threaded_irq().
Suggested-by: Will Deacon <will.deacon@xxxxxxx>
Signed-off-by: Vinayak Kale <vkale@xxxxxxx>
---
kernel/irq/manage.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
index 514bcfd..08fffaf 100644
--- a/kernel/irq/manage.c
+++ b/kernel/irq/manage.c
@@ -1414,10 +1414,12 @@ int request_threaded_irq(unsigned int irq, irq_handler_t handler,
if (!desc)
return -EINVAL;
- if (!irq_settings_can_request(desc) ||
- WARN_ON(irq_settings_is_per_cpu_devid(desc)))
+ if (!irq_settings_can_request(desc))
return -EINVAL;
+ if (irq_settings_is_per_cpu_devid(desc))
+ return -EPERM;
+
if (!handler) {
if (!thread_fn)
return -EINVAL;
@@ -1671,10 +1673,12 @@ int request_percpu_irq(unsigned int irq, irq_handler_t handler,
return -EINVAL;
desc = irq_to_desc(irq);
- if (!desc || !irq_settings_can_request(desc) ||
- !irq_settings_is_per_cpu_devid(desc))
+ if (!desc || !irq_settings_can_request(desc))
return -EINVAL;
+ if (!irq_settings_is_per_cpu_devid(desc))
+ return -EPERM;
+
action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
if (!action)
return -ENOMEM;
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/