Skip to content

Commit

Permalink
rtc: rtc-davinci: return correct error code if rtc_device_register() …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Devendra Naga authored and Linus Torvalds committed Dec 18, 2012
1 parent 32c4746 commit 9ed39bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/rtc/rtc-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 9ed39bf

Please sign in to comment.