[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-4-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:40:53 +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 03/59] rtc: ds1390: 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-ds1390.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/rtc/rtc-ds1390.c b/drivers/rtc/rtc-ds1390.c
index 66fc8617d07e..9e4d09eac323 100644
--- a/drivers/rtc/rtc-ds1390.c
+++ b/drivers/rtc/rtc-ds1390.c
@@ -203,14 +203,13 @@ static int ds1390_probe(struct spi_device *spi)
if (spi->dev.of_node)
ds1390_trickle_of_init(spi);
- chip->rtc = devm_rtc_device_register(&spi->dev, "ds1390",
- &ds1390_rtc_ops, THIS_MODULE);
- if (IS_ERR(chip->rtc)) {
- dev_err(&spi->dev, "unable to register device\n");
- res = PTR_ERR(chip->rtc);
- }
+ chip->rtc = devm_rtc_allocate_device(&spi->dev);
+ if (IS_ERR(chip->rtc))
+ return PTR_ERR(chip->rtc);
+
+ chip->rtc->ops = &ds1390_rtc_ops;
- return res;
+ return devm_rtc_register_device(chip->rtc);
}
static const struct of_device_id ds1390_of_match[] = {
--
2.29.1
Powered by blists - more mailing lists