[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-26-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:41:15 +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 25/59] rtc: lpc24xx: 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-lpc24xx.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-lpc24xx.c b/drivers/rtc/rtc-lpc24xx.c
index eec881a81067..e28a00be2c0d 100644
--- a/drivers/rtc/rtc-lpc24xx.c
+++ b/drivers/rtc/rtc-lpc24xx.c
@@ -247,14 +247,18 @@ static int lpc24xx_rtc_probe(struct platform_device *pdev)
goto disable_clks;
}
- rtc->rtc = devm_rtc_device_register(&pdev->dev, "lpc24xx-rtc",
- &lpc24xx_rtc_ops, THIS_MODULE);
+ rtc->rtc = devm_rtc_allocate_device(&pdev->dev);
if (IS_ERR(rtc->rtc)) {
- dev_err(&pdev->dev, "can't register rtc device\n");
ret = PTR_ERR(rtc->rtc);
goto disable_clks;
}
+ rtc->rtc->ops = &lpc24xx_rtc_ops;
+
+ ret = devm_rtc_register_device(rtc->rtc);
+ if (ret)
+ goto disable_clks;
+
return 0;
disable_clks:
--
2.29.1
Powered by blists - more mailing lists