Skip to contentSkip to conversation

power: generic-adc-battery: Fix checking return value of request_any_context_irq

PATCH Superseded Axel Lin 1 participant 1 message Oct 11, 2012

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 power: generic-adc-battery: Fix checking return value of request_any_context_irq

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

---
 drivers/power/generic-adc-battery.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/generic-adc-battery.c +1 -1
index 9bdf444..4a00ef7 100644
@@ -327,7 +327,7 @@ static int __devinit gab_probe(struct platform_device *pdev)
 		ret = request_any_context_irq(irq, gab_charged,
 				IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING,
 				"battery charged", adc_bat);
-		if (ret)
+		if (ret < 0)
 			goto err_gpio;
 	}
 
Signature · 1 line
1.7.9.5