[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220921114624.3250848-7-linux@rasmusvillemoes.dk>
Date: Wed, 21 Sep 2022 13:46:21 +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 6/9] rtc: isl12022: use dev_set_drvdata() instead of i2c_set_clientdata()
As another preparation for removing direct references to the
i2c_client in the helper functions, stash a pointer to the private
data via dev_set_drvdata() instead of i2c_set_clientdata().
Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
drivers/rtc/rtc-isl12022.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-isl12022.c b/drivers/rtc/rtc-isl12022.c
index d396d6076db5..df6d91f4e8f3 100644
--- a/drivers/rtc/rtc-isl12022.c
+++ b/drivers/rtc/rtc-isl12022.c
@@ -149,7 +149,7 @@ static int isl12022_rtc_read_time(struct device *dev, struct rtc_time *tm)
static int isl12022_rtc_set_time(struct device *dev, struct rtc_time *tm)
{
struct i2c_client *client = to_i2c_client(dev);
- struct isl12022 *isl12022 = i2c_get_clientdata(client);
+ struct isl12022 *isl12022 = dev_get_drvdata(dev);
size_t i;
int ret;
uint8_t buf[ISL12022_REG_DW + 1];
@@ -232,8 +232,7 @@ static int isl12022_probe(struct i2c_client *client)
GFP_KERNEL);
if (!isl12022)
return -ENOMEM;
-
- i2c_set_clientdata(client, isl12022);
+ dev_set_drvdata(&client->dev, isl12022);
isl12022->rtc = devm_rtc_allocate_device(&client->dev);
if (IS_ERR(isl12022->rtc))
--
2.37.2
Powered by blists - more mailing lists