From: Devendra Naga Date: Tue, 18 Dec 2012 00:02:39 +0000 (-0800) Subject: rtc: rtc-davinci: return correct error code if rtc_device_register() fails X-Git-Tag: v3.8-rc1~74^2~79 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9ed39bf931cbd95b30755dcb1ad724fe05565c3f;p=profile%2Fivi%2Fkernel-x86-ivi.git 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 Cc: Alessandro Zummo Cc: Miguel Aguilar Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/rtc/rtc-davinci.c b/drivers/rtc/rtc-davinci.c index 14c2109..fd95316 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; }