Skip to content

Commit

Permalink
mfd: Fix off by one in WM831x IRQ code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dimitris Papastamos authored and Samuel Ortiz committed Jul 31, 2011
1 parent 59dead5 commit 0825671
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/mfd/wm831x-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,11 @@ static int wm831x_irq_set_type(struct irq_data *data, unsigned int type)
return -EINVAL;
}

/* Rebase the IRQ into the GPIO range so we've got a sensible array
* index.
*/
irq -= WM831X_IRQ_GPIO_1;

/* We set the high bit to flag that we need an update; don't
* do the update here as we can be called with the bus lock
* held.
Expand Down

0 comments on commit 0825671

Please sign in to comment.