[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201119114149.4117-11-brgl@bgdev.pl>
Date: Thu, 19 Nov 2020 12:41:00 +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 10/59] rtc: pcf8583: 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-pcf8583.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-pcf8583.c b/drivers/rtc/rtc-pcf8583.c
index c80ca20e5d8d..93c7bb52bb78 100644
--- a/drivers/rtc/rtc-pcf8583.c
+++ b/drivers/rtc/rtc-pcf8583.c
@@ -290,11 +290,13 @@ static int pcf8583_probe(struct i2c_client *client,
i2c_set_clientdata(client, pcf8583);
- pcf8583->rtc = devm_rtc_device_register(&client->dev,
- pcf8583_driver.driver.name,
- &pcf8583_rtc_ops, THIS_MODULE);
+ pcf8583->rtc = devm_rtc_allocate_device(&client->dev);
+ if (IS_ERR(pcf8583->rtc))
+ return PTR_ERR(pcf8583->rtc);
- return PTR_ERR_OR_ZERO(pcf8583->rtc);
+ pcf8583->rtc->ops = &pcf8583_rtc_ops;
+
+ return devm_rtc_register_device(pcf8583->rtc);
}
static const struct i2c_device_id pcf8583_id[] = {
--
2.29.1
Powered by blists - more mailing lists