[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-6-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:40:55 +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 05/59] rtc: rx6110: 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-rx6110.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/rtc/rtc-rx6110.c b/drivers/rtc/rtc-rx6110.c
index a7b671a21022..cdb05b67912e 100644
--- a/drivers/rtc/rtc-rx6110.c
+++ b/drivers/rtc/rtc-rx6110.c
@@ -315,20 +315,18 @@ static int rx6110_probe(struct rx6110_data *rx6110, struct device *dev)
{
int err;
- rx6110->rtc = devm_rtc_device_register(dev,
- RX6110_DRIVER_NAME,
- &rx6110_rtc_ops, THIS_MODULE);
-
+ rx6110->rtc = devm_rtc_allocate_device(dev);
if (IS_ERR(rx6110->rtc))
return PTR_ERR(rx6110->rtc);
+ rx6110->rtc->ops = &rx6110_rtc_ops;
+ rx6110->rtc->max_user_freq = 1;
+
err = rx6110_init(rx6110);
if (err)
return err;
- rx6110->rtc->max_user_freq = 1;
-
- return 0;
+ return devm_rtc_register_device(rx6110->rtc);
}
#ifdef CONFIG_SPI_MASTER
--
2.29.1
Powered by blists - more mailing lists