Commit 7fc9790a authored by Alexandre Belloni's avatar Alexandre Belloni

rtc: au1xxx: convert to devm_rtc_allocate_device

This allows further improvement of the driver.

Link: https://lore.kernel.org/r/20200306005958.39203-1-alexandre.belloni@bootlin.comSigned-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 326bce07
...@@ -99,16 +99,15 @@ static int au1xtoy_rtc_probe(struct platform_device *pdev) ...@@ -99,16 +99,15 @@ static int au1xtoy_rtc_probe(struct platform_device *pdev)
while (alchemy_rdsys(AU1000_SYS_CNTRCTRL) & SYS_CNTRL_C0S) while (alchemy_rdsys(AU1000_SYS_CNTRCTRL) & SYS_CNTRL_C0S)
msleep(1); msleep(1);
rtcdev = devm_rtc_device_register(&pdev->dev, "rtc-au1xxx", rtcdev = devm_rtc_allocate_device(&pdev->dev);
&au1xtoy_rtc_ops, THIS_MODULE); if (IS_ERR(rtcdev))
if (IS_ERR(rtcdev)) { return PTR_ERR(rtcdev);
ret = PTR_ERR(rtcdev);
goto out_err; rtcdev->ops = &au1xtoy_rtc_ops;
}
platform_set_drvdata(pdev, rtcdev); platform_set_drvdata(pdev, rtcdev);
return 0; return rtc_register_device(rtcdev);
out_err: out_err:
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment