mirror of
https://github.com/adulau/aha.git
synced 2024-12-30 20:56:23 +00:00
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>
This commit is contained in:
parent
9c88b6ba1c
commit
29dd0dae50
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue