diff options
author | Ben Hutchings <ben@decadent.org.uk> | 2013-06-27 21:40:30 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2013-06-28 06:56:03 -0400 |
commit | 2779db8d37d4b542d9ca2575f5f178dbeaca6c86 (patch) | |
tree | 2f3053f3d4fab5f4ab37fdcf4fc717c6870f5947 /kernel/irq | |
parent | b8394dee787bbd7d52614b7ca44ea7aa05feb9ad (diff) |
genirq: Fix can_request_irq() for IRQs without an action
Commit 02725e7471b8 ('genirq: Use irq_get/put functions'),
inadvertently changed can_request_irq() to return 0 for IRQs that have
no action. This causes pcibios_lookup_irq() to select only IRQs that
already have an action with IRQF_SHARED set, or to fail if there are
none. Change can_request_irq() to return 1 for IRQs that have no
action (if the first two conditions are met).
Reported-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Tested-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is> (against 3.2)
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Cc: 709647@bugs.debian.org
Cc: stable@vger.kernel.org # 2.6.39+
Link: http://bugs.debian.org/709647
Link: http://lkml.kernel.org/r/1372383630.23847.40.camel@deadeye.wl.decadent.org.uk
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'kernel/irq')
-rw-r--r-- | kernel/irq/manage.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index e16caa81f887..514bcfd855a8 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -555,9 +555,9 @@ int can_request_irq(unsigned int irq, unsigned long irqflags) | |||
555 | return 0; | 555 | return 0; |
556 | 556 | ||
557 | if (irq_settings_can_request(desc)) { | 557 | if (irq_settings_can_request(desc)) { |
558 | if (desc->action) | 558 | if (!desc->action || |
559 | if (irqflags & desc->action->flags & IRQF_SHARED) | 559 | irqflags & desc->action->flags & IRQF_SHARED) |
560 | canrequest =1; | 560 | canrequest = 1; |
561 | } | 561 | } |
562 | irq_put_desc_unlock(desc, flags); | 562 | irq_put_desc_unlock(desc, flags); |
563 | return canrequest; | 563 | return canrequest; |