Skip to contentSkip to conversation

mfd: Ignore non-GPIO IRQs when setting wm831x IRQ types

PATCH Applied Mark Brown 2 participants 2 messages Aug 16, 2010 – Aug 20, 2010

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 mfd: Ignore non-GPIO IRQs when setting wm831x IRQ types

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.

---
 drivers/mfd/wm831x-irq.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
drivers/mfd/wm831x-irq.c +7 -2
index 7dabe4d..294183b 100644
@@ -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:
Signature · 1 line
1.7.1
Applied
#1 lore raw

Hi Mark,

Quoted 3 lines · Mark Brown

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.

Thanks, applied to my for-linus branch.
I'll send it with my next 2.6.36 mfd fixes pull request.

Cheers,
Samuel.

Quoted 29 lines
---
 drivers/mfd/wm831x-irq.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
drivers/mfd/wm831x-irq.c +7 -2
index 7dabe4d..294183b 100644
@@ -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:
Signature · 1 line
1.7.1
Signature · 2 lines
Intel Open Source Technology Centre
http://oss.intel.com/