[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-59-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:41:48 +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 58/59] rtc: lp8788: 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-lp8788.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/rtc/rtc-lp8788.c b/drivers/rtc/rtc-lp8788.c
index c0b8fbce1082..c93bf5566e0b 100644
--- a/drivers/rtc/rtc-lp8788.c
+++ b/drivers/rtc/rtc-lp8788.c
@@ -295,17 +295,16 @@ static int lp8788_rtc_probe(struct platform_device *pdev)
device_init_wakeup(dev, 1);
- rtc->rdev = devm_rtc_device_register(dev, "lp8788_rtc",
- &lp8788_rtc_ops, THIS_MODULE);
- if (IS_ERR(rtc->rdev)) {
- dev_err(dev, "can not register rtc device\n");
+ rtc->rdev = devm_rtc_allocate_device(dev);
+ if (IS_ERR(rtc->rdev))
return PTR_ERR(rtc->rdev);
- }
+
+ rtc->rdev->ops = &lp8788_rtc_ops;
if (lp8788_alarm_irq_register(pdev, rtc))
dev_warn(lp->dev, "no rtc irq handler\n");
- return 0;
+ return devm_rtc_register_device(rtc->rdev);
}
static struct platform_driver lp8788_rtc_driver = {
--
2.29.1
Powered by blists - more mailing lists