Skip to content

Commit

Permalink
[ARM] VIC: Fix resume sources usage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Dooks committed Jun 16, 2009
1 parent f25f0b9 commit 3f1a567
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions arch/arm/common/vic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3f1a567

Please sign in to comment.