Skip to contentSkip to conversation

Input: twl4030-pwrbutton - pass the IRQF_ONESHOT flag

PATCH Applied Fabio Estevam 2 participants 5 messages May 15, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 Input: twl4030-pwrbutton - pass the IRQF_ONESHOT flag

From: Fabio Estevam <[email protected]>

Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail.

So pass the IRQF_ONESHOT flag in this case.

The semantic patch that makes this change is available in scripts/coccinelle/misc/irqf_oneshot.cocci.

---
 drivers/input/misc/twl4030-pwrbutton.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/misc/twl4030-pwrbutton.c +2 -1
index e98cc81..603fc2f 100644
@@ -71,7 +71,8 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev)
 	pwr->dev.parent = &pdev->dev;
 
 	err = devm_request_threaded_irq(&pwr->dev, irq, NULL, powerbutton_irq,
-			IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
+			IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING |
+			IRQF_ONESHOT,
 			"twl4030_pwrbutton", pwr);
 	if (err < 0) {
 		dev_err(&pdev->dev, "Can't get IRQ for pwrbutton: %d\n", err);
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/4 Input: retu-pwrbutton - pass the IRQF_ONESHOT flag

From: Fabio Estevam <[email protected]>

Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail.

So pass the IRQF_ONESHOT flag in this case.

The semantic patch that makes this change is available in scripts/coccinelle/misc/irqf_oneshot.cocci.

---
 drivers/input/misc/retu-pwrbutton.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/misc/retu-pwrbutton.c +2 -1
index 0c8ac60..30b459b 100644
@@ -63,7 +63,8 @@ static int retu_pwrbutton_probe(struct platform_device *pdev)
 	input_set_drvdata(idev, rdev);
 
 	error = devm_request_threaded_irq(&pdev->dev, irq,
-					  NULL, retu_pwrbutton_irq, 0,
+					  NULL, retu_pwrbutton_irq,
+					  IRQF_ONESHOT,
 					  "retu-pwrbutton", idev);
 	if (error)
 		return error;
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/4 Input: twl6040-vibra - pass the IRQF_ONESHOT flag

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail.

So pass the IRQF_ONESHOT flag in this case.

The semantic patch that makes this change is available in scripts/coccinelle/misc/irqf_oneshot.cocci.

---
 drivers/input/misc/twl6040-vibra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/misc/twl6040-vibra.c +2 -1
index 0e0d094..ea63fad 100644
@@ -308,7 +308,8 @@ static int twl6040_vibra_probe(struct platform_device *pdev)
 	mutex_init(&info->mutex);
 
 	error = devm_request_threaded_irq(&pdev->dev, info->irq, NULL,
-					  twl6040_vib_irq_handler, 0,
+					  twl6040_vib_irq_handler,
+					  IRQF_ONESHOT,
 					  "twl6040_irq_vib", info);
 	if (error) {
 		dev_err(info->dev, "VIB IRQ request failed: %d\n", error);
Signature · 1 line
1.9.1
#3 lore raw

PATCH 4/4 Input: wm831x-on - pass the IRQF_ONESHOT flag

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail.

So pass the IRQF_ONESHOT flag in this case.

The semantic patch that makes this change is available in scripts/coccinelle/misc/irqf_oneshot.cocci.

---
 drivers/input/misc/wm831x-on.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/misc/wm831x-on.c +2 -1
index 59d4f7b..1b44de2 100644
@@ -99,7 +99,8 @@ static int wm831x_on_probe(struct platform_device *pdev)
 	wm831x_on->dev->dev.parent = &pdev->dev;
 
 	ret = request_threaded_irq(irq, NULL, wm831x_on_irq,
-				   IRQF_TRIGGER_RISING, "wm831x_on",
+				   IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+				   "wm831x_on",
 				   wm831x_on);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret);
Signature · 1 line
1.9.1
maintainer Applied
#4 lore raw

Re: [PATCH 4/4] Input: wm831x-on - pass the IRQF_ONESHOT flag

Quoted 6 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Since commit 1c6c69525b40eb76de8adf039409722015927dc3 ("genirq: Reject bogus threaded irq requests") threaded IRQs without a primary handler need to be requested with IRQF_ONESHOT, otherwise the request will fail.

Quoted 6 lines

So pass the IRQF_ONESHOT flag in this case.

The semantic patch that makes this change is available in scripts/coccinelle/misc/irqf_oneshot.cocci.

Applied all 4, thank you.

Quoted 21 lines
---
 drivers/input/misc/wm831x-on.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/input/misc/wm831x-on.c +2 -1
index 59d4f7b..1b44de2 100644
@@ -99,7 +99,8 @@ static int wm831x_on_probe(struct platform_device *pdev)
 	wm831x_on->dev->dev.parent = &pdev->dev;
 
 	ret = request_threaded_irq(irq, NULL, wm831x_on_irq,
-				   IRQF_TRIGGER_RISING, "wm831x_on",
+				   IRQF_TRIGGER_RISING | IRQF_ONESHOT,
+				   "wm831x_on",
 				   wm831x_on);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Unable to request IRQ: %d\n", ret);
Signature · 1 line
1.9.1
Signature · 1 line
Dmitry