Skip to content

Commit

Permalink
mfd: Ignore non-GPIO IRQs when setting wm831x IRQ types
Browse files Browse the repository at this point in the history
The driver was originally tested with an additional patch which
made this unneeded but that patch had issuges and got lost on the
way to mainline, causing problems when the errors are reported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Cc: stable@kernel.org
  • Loading branch information
Mark Brown authored and Samuel Ortiz committed Sep 29, 2010
1 parent 899611e commit c9d66d3
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/mfd/wm831x-irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,13 @@ static int wm831x_irq_set_type(unsigned int irq, unsigned int type)

irq = irq - wm831x->irq_base;

if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11)
return -EINVAL;
if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) {
/* Ignore internal-only IRQs */
if (irq >= 0 && irq < WM831X_NUM_IRQS)
return 0;
else
return -EINVAL;
}

switch (type) {
case IRQ_TYPE_EDGE_BOTH:
Expand Down

0 comments on commit c9d66d3

Please sign in to comment.