summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/pcf50633-core.c
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-28 14:28:08 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2010-05-28 01:37:32 +0200
commit165bce9783ab307368e56b7c1a168520a3791266 (patch)
treef199c3c7177606814b968bd45bfa751ef72bce51 /drivers/mfd/pcf50633-core.c
parent2a0cb351001bebf195d3c43d0f70441eb6a62652 (diff)
downloadblackbird-op-linux-165bce9783ab307368e56b7c1a168520a3791266.tar.gz
blackbird-op-linux-165bce9783ab307368e56b7c1a168520a3791266.zip
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/pcf50633-core.c')
-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 = {
int pcf50633_register_irq(struct pcf50633 *pcf, int irq,
void (*handler) (int, void *), void *data)
{
- if (irq < 0 || irq > PCF50633_NUM_IRQ || !handler)
+ if (irq < 0 || irq >= PCF50633_NUM_IRQ || !handler)
return -EINVAL;
if (WARN_ON(pcf->irq_handler[irq].handler))
@@ -235,7 +235,7 @@ EXPORT_SYMBOL_GPL(pcf50633_register_irq);
int pcf50633_free_irq(struct pcf50633 *pcf, int irq)
{
- if (irq < 0 || irq > PCF50633_NUM_IRQ)
+ if (irq < 0 || irq >= PCF50633_NUM_IRQ)
return -EINVAL;
mutex_lock(&pcf->lock);
OpenPOWER on IntegriCloud