Skip to content

Commit 31b108a

Browse files
Villemoesalexandrebelloni
authored andcommitted
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@rasmusvillemoes.dk> Link: https://lore.kernel.org/r/20220921114624.3250848-7-linux@rasmusvillemoes.dk Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 7093b8a commit 31b108a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/rtc/rtc-isl12022.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ static int isl12022_rtc_read_time(struct device *dev, struct rtc_time *tm)
149149
static int isl12022_rtc_set_time(struct device *dev, struct rtc_time *tm)
150150
{
151151
struct i2c_client *client = to_i2c_client(dev);
152-
struct isl12022 *isl12022 = i2c_get_clientdata(client);
152+
struct isl12022 *isl12022 = dev_get_drvdata(dev);
153153
size_t i;
154154
int ret;
155155
uint8_t buf[ISL12022_REG_DW + 1];
@@ -232,8 +232,7 @@ static int isl12022_probe(struct i2c_client *client)
232232
GFP_KERNEL);
233233
if (!isl12022)
234234
return -ENOMEM;
235-
236-
i2c_set_clientdata(client, isl12022);
235+
dev_set_drvdata(&client->dev, isl12022);
237236

238237
isl12022->rtc = devm_rtc_allocate_device(&client->dev);
239238
if (IS_ERR(isl12022->rtc))

0 commit comments

Comments
 (0)