aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-28 07:28:08 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2010-05-27 19:37:32 -0400
commit165bce9783ab307368e56b7c1a168520a3791266 (patch)
treef199c3c7177606814b968bd45bfa751ef72bce51 /drivers/mfd
parent2a0cb351001bebf195d3c43d0f70441eb6a62652 (diff)
mfd: Proper pcf50633 irq check
"pcf->irq_handler" has PCF50633_NUM_IRQ elements. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/pcf50633-core.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/pcf50633-core.c b/drivers/mfd/pcf50633-core.c
index 710e417e0eec..5439282804cc 100644
--- a/drivers/mfd/pcf50633-core.c
+++ b/drivers/mfd/pcf50633-core.c
@@ -218,7 +218,7 @@ static struct attribute_group pcf_attr_group = {
218int pcf50633_register_irq(struct pcf50633 *pcf, int irq, 218int pcf50633_register_irq(struct pcf50633 *pcf, int irq,
219 void (*handler) (int, void *), void *data) 219 void (*handler) (int, void *), void *data)
220{ 220{
221 if (irq < 0 || irq > PCF50633_NUM_IRQ || !handler) 221 if (irq < 0 || irq >= PCF50633_NUM_IRQ || !handler)
222 return -EINVAL; 222 return -EINVAL;
223 223
224 if (WARN_ON(pcf->irq_handler[irq].handler)) 224 if (WARN_ON(pcf->irq_handler[irq].handler))
@@ -235,7 +235,7 @@ EXPORT_SYMBOL_GPL(pcf50633_register_irq);
235 235
236int pcf50633_free_irq(struct pcf50633 *pcf, int irq) 236int pcf50633_free_irq(struct pcf50633 *pcf, int irq)
237{ 237{
238 if (irq < 0 || irq > PCF50633_NUM_IRQ) 238 if (irq < 0 || irq >= PCF50633_NUM_IRQ)
239 return -EINVAL; 239 return -EINVAL;
240 240
241 mutex_lock(&pcf->lock); 241 mutex_lock(&pcf->lock);