Thread (17 messages) 17 messages, 6 authors, 2016-05-10

Re: [PATCH v6 6/9] rtc: max8997: Check for ERRNO of regmap_irq_get_virq()

From: Alexandre Belloni <hidden>
Date: 2016-05-07 06:48:54
Also in: linux-arm-kernel, linux-input, linux-leds, linux-pm, linux-rtc, linux-samsung-soc, lkml

On 06/05/2016 at 09:27:13 +0200, Krzysztof Kozlowski wrote :
The regmap_irq_get_virq() can return zero or negative ERRNO, so it is
insufficient to check only for non-zero value.

Signed-off-by: Krzysztof Kozlowski <redacted>
Acked-by: Alexandre Belloni <redacted>
quoted hunk ↗ jump to hunk
---
 drivers/rtc/rtc-max8997.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-max8997.c b/drivers/rtc/rtc-max8997.c
index 4998aee0f07f..1a06e17ebe9b 100644
--- a/drivers/rtc/rtc-max8997.c
+++ b/drivers/rtc/rtc-max8997.c
@@ -497,7 +497,7 @@ static int max8997_rtc_probe(struct platform_device *pdev)
 	}
 
 	virq = regmap_irq_get_virq(max8997->irq_data, MAX8997_PMICIRQ_RTCA1);
-	if (!virq) {
+	if (virq <= 0) {
 		dev_err(&pdev->dev, "Failed to create mapping alarm IRQ\n");
 		ret = -ENXIO;
 		goto err_out;
-- 
1.9.1
-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help