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

Bartosz Golaszewski
2020-11-19T11:48:24Z

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