diff mbox

[v2,2/5] drivers/rtc/rtc-tps65910.c: Fix incorrect return value on error

Message ID 1364271162-18141-3-git-send-email-sachin.kamat@linaro.org
State Accepted
Headers show

Commit Message

Sachin Kamat March 26, 2013, 4:12 a.m. UTC
'ret' was not initialized to correct error value before
returning. Since 'irq' is also being tested for 0, we cannot
return irq itself as it means function is success even though we
are returning before completing the probe.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Venu Byravarasu <vbyravarasu@nvidia.com>
---
 drivers/rtc/rtc-tps65910.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index 26b8bd2..a9caf04 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -263,7 +263,7 @@  static int tps65910_rtc_probe(struct platform_device *pdev)
 	if (irq <= 0) {
 		dev_warn(&pdev->dev, "Wake up is not possible as irq = %d\n",
 			irq);
-		return ret;
+		return -ENXIO;
 	}
 
 	ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,