[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-23-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:41:12 +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 22/59] rtc: moxart: 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-moxart.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/rtc/rtc-moxart.c b/drivers/rtc/rtc-moxart.c
index 6b24ac9e1cfa..f354bc8abecf 100644
--- a/drivers/rtc/rtc-moxart.c
+++ b/drivers/rtc/rtc-moxart.c
@@ -294,15 +294,13 @@ static int moxart_rtc_probe(struct platform_device *pdev)
return ret;
}
- moxart_rtc->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
- &moxart_rtc_ops,
- THIS_MODULE);
- if (IS_ERR(moxart_rtc->rtc)) {
- dev_err(&pdev->dev, "devm_rtc_device_register failed\n");
+ moxart_rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
+ if (IS_ERR(moxart_rtc->rtc))
return PTR_ERR(moxart_rtc->rtc);
- }
- return 0;
+ moxart_rtc->rtc->ops = &moxart_rtc_ops;
+
+ return devm_rtc_register_device(moxart_rtc->rtc);
}
static const struct of_device_id moxart_rtc_match[] = {
--
2.29.1
Powered by blists - more mailing lists