[PATCH] rtc: ds1307: drop redundant dev_set_drvdata() in probe
| Newsgroups | org.kernel.vger.linux-rtc,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
From: Guoming Chen <[email protected]> i2c_set_clientdata() is a thin wrapper around dev_set_drvdata(&client->dev, ...), so calling both in ds1307_probe() stores the same driver-data pointer twice. The two calls were introduced together in the regmap conversion in commit 11e5890b5342c ("rtc: ds1307: convert driver to regmap"). Keep i2c_set_clientdata(), which matches the convention used by every other I2C RTC driver in the subsystem, and drop the redundant dev_set_drvdata(). Signed-off-by: Guoming Chen <[email protected]> --- drivers/rtc/rtc-ds1307.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c index fd3858b6569e..5913210183b8 100644 --- a/drivers/rtc/rtc-ds1307.c +++ b/drivers/rtc/rtc-ds1307.c @@ -1891,7 +1891,6 @@ static int ds1307_probe(struct i2c_client *client) if (!ds1307) return -ENOMEM; - dev_set_drvdata(&client->dev, ds1307); ds1307->dev = &client->dev; ds1307->name = client->name; -- 2.34.1