[PATCH 51/59] rtc: ds1216: stop using deprecated RTC API

Bartosz Golaszewski
2020-11-19T11:43:42Z

drivers/rtc/rtc-ds1216.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/rtc/rtc-ds1216.c b/drivers/rtc/rtc-ds1216.c
index 7eeb3f359de8..594f39d4e916 100644
--- a/drivers/rtc/rtc-ds1216.c
+++ b/drivers/rtc/rtc-ds1216.c
@@ -150,14 +150,16 @@ static int __init ds1216_rtc_probe(struct platform_device *pdev)
if (IS_ERR(priv->ioaddr))
return PTR_ERR(priv->ioaddr);

- priv->rtc = devm_rtc_device_register(&pdev->dev, "ds1216",
- &ds1216_rtc_ops, THIS_MODULE);
+ priv->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(priv->rtc))
return PTR_ERR(priv->rtc);

+ priv->rtc->ops = &ds1216_rtc_ops;
+
/* dummy read to get clock into a known state */
ds1216_read(priv->ioaddr, dummy);
- return 0;
+
+ return devm_rtc_register_device(priv->rtc);
}

static struct platform_driver ds1216_rtc_platform_driver = {
--
2.29.1