rtc: ls1x: switch to rtc_register_device
This allows for future improvement of the driver. Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
This commit is contained in:
parent
180c92c4ae
commit
52f0e7bc19
|
@ -173,15 +173,15 @@ static int ls1x_rtc_probe(struct platform_device *pdev)
|
||||||
while (readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TTS)
|
while (readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_TTS)
|
||||||
usleep_range(1000, 3000);
|
usleep_range(1000, 3000);
|
||||||
|
|
||||||
rtcdev = devm_rtc_device_register(&pdev->dev, "ls1x-rtc",
|
rtcdev = devm_rtc_allocate_device(&pdev->dev);
|
||||||
&ls1x_rtc_ops , THIS_MODULE);
|
if (IS_ERR(rtcdev))
|
||||||
if (IS_ERR(rtcdev)) {
|
return PTR_ERR(rtcdev);
|
||||||
ret = PTR_ERR(rtcdev);
|
|
||||||
goto err;
|
|
||||||
}
|
|
||||||
|
|
||||||
platform_set_drvdata(pdev, rtcdev);
|
platform_set_drvdata(pdev, rtcdev);
|
||||||
return 0;
|
rtcdev->ops = &ls1x_rtc_ops;
|
||||||
|
|
||||||
|
return rtc_register_device(rtcdev);
|
||||||
|
|
||||||
err:
|
err:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue