Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

Sachin Kamat and committed by
Linus Torvalds
dbda161b ad3f3cf4

+1 -1
+1 -1
drivers/rtc/rtc-tps65910.c
··· 263 263 if (irq <= 0) { 264 264 dev_warn(&pdev->dev, "Wake up is not possible as irq = %d\n", 265 265 irq); 266 - return ret; 266 + return -ENXIO; 267 267 } 268 268 269 269 ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,