Skip to content

Commit

Permalink
drivers/rtc/rtc-tps65910.c: fix incorrect return value on error
Browse files Browse the repository at this point in the history
'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>
Cc: Chiwoong Byun <woong.byun@samsung.com>
Cc: Jonghwa Lee <jonghwa3.lee@samsung.com>
Cc: Laxman dewangan <ldewangan@nvidia.com>
Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Sachin Kamat authored and Linus Torvalds committed Apr 30, 2013
1 parent ad3f3cf commit dbda161
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-tps65910.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit dbda161

Please sign in to comment.