aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2007-11-07 00:58:09 -0500
committerPaul Mundt <lethal@linux-sh.org>2007-11-07 00:58:09 -0500
commit29dd0dae507f73f305aaea765f975eafd1fa5493 (patch)
tree9ce766a017cbf18a408f8341c4c1e24a2d711aaa /drivers/rtc
parent9c88b6ba1c72a8bba30347b63f1531f2d9c2a309 (diff)
rtc: sh-rtc: Handle rtc_device_register() failure properly.
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>
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-sh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 78277a118b67..61caed506c31 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -588,7 +588,7 @@ static int __devinit sh_rtc_probe(struct platform_device *pdev)
588 588
589 rtc->rtc_dev = rtc_device_register("sh", &pdev->dev, 589 rtc->rtc_dev = rtc_device_register("sh", &pdev->dev,
590 &sh_rtc_ops, THIS_MODULE); 590 &sh_rtc_ops, THIS_MODULE);
591 if (IS_ERR(rtc)) { 591 if (IS_ERR(rtc->rtc_dev)) {
592 ret = PTR_ERR(rtc->rtc_dev); 592 ret = PTR_ERR(rtc->rtc_dev);
593 goto err_badmap; 593 goto err_badmap;
594 } 594 }