public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power: gpio-charger: Fix checking return value of request_any_context_irq
@ 2011-07-04 10:04 Axel Lin
  2011-07-04 10:13 ` Lars-Peter Clausen
  0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2011-07-04 10:04 UTC (permalink / raw)
  To: linux-kernel; +Cc: Anton Vorontsov, Lars-Peter Clausen

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

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/power/gpio-charger.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/power/gpio-charger.c b/drivers/power/gpio-charger.c
index 718f2c5..a64b885 100644
--- a/drivers/power/gpio-charger.c
+++ b/drivers/power/gpio-charger.c
@@ -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;
-- 
1.7.4.1




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-08 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-04 10:04 [PATCH] power: gpio-charger: Fix checking return value of request_any_context_irq Axel Lin
2011-07-04 10:13 ` Lars-Peter Clausen
2011-07-08 13:19   ` Anton Vorontsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox