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>
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];
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))