diff mbox series

[05/59] rtc: rx6110: stop using deprecated RTC API

Message ID 20201119114149.4117-6-brgl@bgdev.pl
State Rejected
Headers show
Series rtc: remove all uses of devm_rtc_device_register() | expand

Commit Message

Bartosz Golaszewski Nov. 19, 2020, 11:40 a.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.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@baylibre.com>
---
 drivers/rtc/rtc-rx6110.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
diff mbox series

Patch

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