]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.35.8/mfd-ignore-non-gpio-irqs-when-setting-wm831x-irq-types.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.35.8 / mfd-ignore-non-gpio-irqs-when-setting-wm831x-irq-types.patch
CommitLineData
7691b2d1
GKH
1From c9d66d3515bbb0ad8062721487de7ade02d2b936 Mon Sep 17 00:00:00 2001
2From: Mark Brown <broonie@opensource.wolfsonmicro.com>
3Date: Mon, 16 Aug 2010 20:26:51 +0100
4Subject: mfd: Ignore non-GPIO IRQs when setting wm831x IRQ types
5
6From: Mark Brown <broonie@opensource.wolfsonmicro.com>
7
8commit c9d66d3515bbb0ad8062721487de7ade02d2b936 upstream.
9
10The driver was originally tested with an additional patch which
11made this unneeded but that patch had issuges and got lost on the
12way to mainline, causing problems when the errors are reported.
13
14Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
15Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17
18---
19 drivers/mfd/wm831x-irq.c | 9 +++++++--
20 1 file changed, 7 insertions(+), 2 deletions(-)
21
22--- a/drivers/mfd/wm831x-irq.c
23+++ b/drivers/mfd/wm831x-irq.c
24@@ -394,8 +394,13 @@ static int wm831x_irq_set_type(unsigned
25
26 irq = irq - wm831x->irq_base;
27
28- if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11)
29- return -EINVAL;
30+ if (irq < WM831X_IRQ_GPIO_1 || irq > WM831X_IRQ_GPIO_11) {
31+ /* Ignore internal-only IRQs */
32+ if (irq >= 0 && irq < WM831X_NUM_IRQS)
33+ return 0;
34+ else
35+ return -EINVAL;
36+ }
37
38 switch (type) {
39 case IRQ_TYPE_EDGE_BOTH: