From: Sachin Kamat Date: Mon, 29 Apr 2013 23:20:10 +0000 (-0700) Subject: drivers/rtc/rtc-tps65910.c: fix incorrect return value on error X-Git-Tag: upstream/snapshot3+hdmi~5276^2~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dbda161be8ae43133bbeac34da3ad99ffeb63556;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git drivers/rtc/rtc-tps65910.c: fix incorrect return value on error '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 Acked-by: Venu Byravarasu Cc: Chiwoong Byun Cc: Jonghwa Lee Cc: Laxman dewangan Cc: Jingoo Han Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- 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,