aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/common/vic.c
diff options
context:
space:
mode:
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)
229{ 229{
230 struct vic_device *v = vic_from_irq(irq); 230 struct vic_device *v = vic_from_irq(irq);
231 unsigned int off = irq & 31; 231 unsigned int off = irq & 31;
232 u32 bit = 1 << off;
232 233
233 if (!v) 234 if (!v)
234 return -EINVAL; 235 return -EINVAL;
235 236
237 if (!(bit & v->resume_sources))
238 return -EINVAL;
239
236 if (on) 240 if (on)
237 v->resume_irqs |= 1 << off; 241 v->resume_irqs |= bit;
238 else 242 else
239 v->resume_irqs &= ~(1 << off); 243 v->resume_irqs &= ~bit;
240 244
241 return 0; 245 return 0;
242} 246}