summaryrefslogtreecommitdiffstats
path: root/arch/arm/common/vic.c
diff options
context:
space:
mode:
authorBen Dooks2009-06-02 10:31:03 +0200
committerBen Dooks2009-06-17 00:30:12 +0200
commit3f1a567d8a4ed7a5d105bd049343606f5273b603 (patch)
tree463f13bdb05c88df5fbf7f26ec8bfe47fc1a98b8 /arch/arm/common/vic.c
parents3cmci: fix dma configuration call (diff)
downloadkernel-qcow2-linux-3f1a567d8a4ed7a5d105bd049343606f5273b603.tar.gz
kernel-qcow2-linux-3f1a567d8a4ed7a5d105bd049343606f5273b603.tar.xz
kernel-qcow2-linux-3f1a567d8a4ed7a5d105bd049343606f5273b603.zip
[ARM] VIC: Fix resume sources usage
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>
Diffstat (limited to 'arch/arm/common/vic.c')
-rw-r--r--arch/arm/common/vic.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c
index 887c6eb3a18a..6ed89836e908 100644
--- a/arch/arm/common/vic.c
+++ b/arch/arm/common/vic.c
@@ -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;
}