aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/wm831x-irq.c
diff options
context:
space:
mode:
authorDimitris Papastamos <dp@opensource.wolfsonmicro.com>2011-06-21 19:23:08 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-07-31 17:28:24 -0400
commit08256712a2705f3ced3e54c3728932c9c39b58ad (patch)
treedb99a1a5ed97be52334ac06f0525b2a3bb5d52e9 /drivers/mfd/wm831x-irq.c
parent59dead5a0c65abed0fe997a69692c11fcd0b11ca (diff)
mfd: Fix off by one in WM831x IRQ code
The GPIO IRQs aren't the first IRQs defined, we need to subtract the base for the GPIOs as well to use them for array indexes. Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/wm831x-irq.c')
-rw-r--r--drivers/mfd/wm831x-irq.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mfd/wm831x-irq.c b/drivers/mfd/wm831x-irq.c
index 1808deb8083b..6c3408ca2c2d 100644
--- a/drivers/mfd/wm831x-irq.c
+++ b/drivers/mfd/wm831x-irq.c
@@ -408,6 +408,11 @@ static int wm831x_irq_set_type(struct irq_data *data, unsigned int type)
408 return -EINVAL; 408 return -EINVAL;
409 } 409 }
410 410
411 /* Rebase the IRQ into the GPIO range so we've got a sensible array
412 * index.
413 */
414 irq -= WM831X_IRQ_GPIO_1;
415
411 /* We set the high bit to flag that we need an update; don't 416 /* We set the high bit to flag that we need an update; don't
412 * do the update here as we can be called with the bus lock 417 * do the update here as we can be called with the bus lock
413 * held. 418 * held.