diff options
| -rw-r--r-- | drivers/mfd/pcf50633-core.c | 4 |
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 = { | |||
| 218 | int pcf50633_register_irq(struct pcf50633 *pcf, int irq, | 218 | int 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 | ||
| 236 | int pcf50633_free_irq(struct pcf50633 *pcf, int irq) | 236 | int 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); |
