]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Dove: Fix irq_to_pmu()
authorRussell King - ARM Linux <linux@arm.linux.org.uk>
Sun, 18 Nov 2012 16:39:32 +0000 (16:39 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 10 Dec 2012 19:13:09 +0000 (11:13 -0800)
commit d356cf5a74afa32b40decca3c9dd88bc3cd63eb5 upstream.

PMU interrupts start at IRQ_DOVE_PMU_START, not IRQ_DOVE_PMU_START + 1.
Fix the condition.  (It may have been less likely to occur had the code
been written "if (irq >= IRQ_DOVE_PMU_START" which imho is the easier
to understand notation, and matches the normal way of thinking about
these things.)

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/mach-dove/include/mach/pm.h

index 3ad9f946a9e8f8ef416aee2c4e8f5f29eb757c8c..11799c33475e475cc33f7e86dc126fb0ad9edf12 100644 (file)
@@ -45,7 +45,7 @@ static inline int pmu_to_irq(int pin)
 
 static inline int irq_to_pmu(int irq)
 {
-       if (IRQ_DOVE_PMU_START < irq && irq < NR_IRQS)
+       if (IRQ_DOVE_PMU_START <= irq && irq < NR_IRQS)
                return irq - IRQ_DOVE_PMU_START;
 
        return -EINVAL;