[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220921114624.3250848-2-linux@rasmusvillemoes.dk>
Date: Wed, 21 Sep 2022 13:46:16 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>
Cc: Rasmus Villemoes <linux@...musvillemoes.dk>,
linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 1/9] rtc: isl12022: stop using deprecated devm_rtc_device_register()
The comments say that devm_rtc_device_register() is deprecated and
that one should instead use devm_rtc_allocate_device() and
[devm_]rtc_register_device. So do that.
Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
drivers/rtc/rtc-isl12022.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c
index 79461ded1a48..2dc19061cf5f 100644
--- a/drivers/rtc/rtc-isl12022.c
+++ b/drivers/rtc/rtc-isl12022.c
@@ -246,10 +246,13 @@ static int isl12022_probe(struct i2c_client *client)
i2c_set_clientdata(client, isl12022);
- isl12022->rtc = devm_rtc_device_register(&client->dev,
- isl12022_driver.driver.name,
- &isl12022_rtc_ops, THIS_MODULE);
- return PTR_ERR_OR_ZERO(isl12022->rtc);
+ isl12022->rtc = devm_rtc_allocate_device(&client->dev);
+ if (IS_ERR(isl12022->rtc))
+ return PTR_ERR(isl12022->rtc);
+
+ isl12022->rtc->ops = &isl12022_rtc_ops;
+
+ return devm_rtc_register_device(isl12022->rtc);
}
#ifdef CONFIG_OF
--
2.37.2
Powered by blists - more mailing lists