Skip to content

Commit

Permalink
rtc: sh-rtc: Handle rtc_device_register() failure properly.
Browse files Browse the repository at this point in the history
Currently if rtc_device_register() fails we have an IS_ERR() on
the wrong pointer, which causes this to always be skipped. Fix
this up to actually check the right pointer. The return value
was always correct, even though the check was wrong.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Nov 7, 2007
1 parent 9c88b6b commit 29dd0da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-sh.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)

rtc->rtc_dev = rtc_device_register("sh", &pdev->dev,
&sh_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) {
if (IS_ERR(rtc->rtc_dev)) {
ret = PTR_ERR(rtc->rtc_dev);
goto err_badmap;
}
Expand Down

0 comments on commit 29dd0da

Please sign in to comment.