[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-52-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:41:41 +0100
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH 51/59] rtc: ds1216: stop using deprecated RTC API
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
devm_rtc_device_register() is deprecated. Use devm_rtc_allocate_device()
and devm_rtc_register_device() pair instead.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
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
Powered by blists - more mailing lists