[ARM] VIC: Fix resume sources usage
authorBen Dooks <ben-linux@fluff.org>
Tue, 2 Jun 2009 08:31:03 +0000 (09:31 +0100)
committerBen Dooks <ben-linux@fluff.org>
Tue, 16 Jun 2009 22:30:12 +0000 (23:30 +0100)
The resume_mask wasn't being checked in vic_set_wake()
to see if the IRQ was a valid wakeup source.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
arch/arm/common/vic.c

index 887c6eb..6ed8983 100644 (file)
@@ -229,14 +229,18 @@ static int vic_set_wake(unsigned int irq, unsigned int on)
 {
        struct vic_device *v = vic_from_irq(irq);
        unsigned int off = irq & 31;
+       u32 bit = 1 << off;
 
        if (!v)
                return -EINVAL;
 
+       if (!(bit & v->resume_sources))
+               return -EINVAL;
+
        if (on)
-               v->resume_irqs |= 1 << off;
+               v->resume_irqs |= bit;
        else
-               v->resume_irqs &= ~(1 << off);
+               v->resume_irqs &= ~bit;
 
        return 0;
 }