Skip to contentSkip to conversation

power: gpio-charger: Fix checking return value of request_any_context_irq

PATCH Applied Axel Lin 3 participants 3 messages Jul 4, 2011 – Jul 8, 2011

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 power: gpio-charger: Fix checking return value of request_any_context_irq

request_any_context_irq() returns a negative value on failure. On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED.

---
 drivers/power/gpio-charger.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/power/gpio-charger.c +1 -1
index 718f2c5..a64b885 100644
@@ -127,7 +127,7 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev)
 		ret = request_any_context_irq(irq, gpio_charger_irq,
 				IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 				dev_name(&pdev->dev), charger);
-		if (ret)
+		if (ret < 0)
 			dev_warn(&pdev->dev, "Failed to request irq: %d\n", ret);
 		else
 			gpio_charger->irq = irq;
Signature · 1 line
1.7.4.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Axel Lin

request_any_context_irq() returns a negative value on failure. On success, it returns either IRQC_IS_HARDIRQ or IRQC_IS_NESTED.

Thanks

Quoted 17 lines
---
 drivers/power/gpio-charger.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/power/gpio-charger.c +1 -1
index 718f2c5..a64b885 100644
@@ -127,7 +127,7 @@ static int __devinit gpio_charger_probe(struct platform_device *pdev)
 		ret = request_any_context_irq(irq, gpio_charger_irq,
 				IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 				dev_name(&pdev->dev), charger);
-		if (ret)
+		if (ret < 0)
 			dev_warn(&pdev->dev, "Failed to request irq: %d\n", ret);
 		else
 			gpio_charger->irq = irq;