summaryrefslogtreecommitdiff
path: root/drivers/rtc/rtc-davinci.c
diff options
context:
space:
mode:
authorDevendra Naga <devendra.aaru@gmail.com>2012-12-18 04:02:39 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-18 05:15:21 +0400
commit9ed39bf931cbd95b30755dcb1ad724fe05565c3f (patch)
treefff3e08eecd61f1494258a5a57a5a9106dd9535b /drivers/rtc/rtc-davinci.c
parent32c4746c24728a047a1ef985215edec798bfce1f (diff)
downloadlinux-9ed39bf931cbd95b30755dcb1ad724fe05565c3f.tar.xz
rtc: rtc-davinci: return correct error code if rtc_device_register() fails
rtc_device_register() returns a pointer containing error code in case of error. Use that in the error return. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-davinci.c')
-rw-r--r--drivers/rtc/rtc-davinci.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c
index 14c2109dbaa3..fd95316743c9 100644
--- a/drivers/rtc/rtc-davinci.c
+++ b/drivers/rtc/rtc-davinci.c
@@ -529,8 +529,9 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
davinci_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
&davinci_rtc_ops, THIS_MODULE);
if (IS_ERR(davinci_rtc->rtc)) {
- dev_err(dev, "unable to register RTC device, err %ld\n",
- PTR_ERR(davinci_rtc->rtc));
+ ret = PTR_ERR(davinci_rtc->rtc);
+ dev_err(dev, "unable to register RTC device, err %d\n",
+ ret);
goto fail3;
}