mfd: Remove redundant dev_set_drvdata() from I2C drivers
authorGuiting Shen <aarongt.shen@gmail.com>
Tue, 25 Apr 2023 02:45:26 +0000 (10:45 +0800)
committerLee Jones <lee@kernel.org>
Thu, 15 Jun 2023 08:19:37 +0000 (09:19 +0100)
the i2c_set_clientdata() is the inline function which is complemented by
the dev_set_drvdata() internally. Do not need to use i2c_set_clientdata()
and dev_set_drvdata() at the same time.

Signed-off-by: Guiting Shen <aarongt.shen@gmail.com>
Reviewed-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230425024526.6443-1-aarongt.shen@gmail.com
drivers/mfd/88pm80x.c
drivers/mfd/88pm860x-core.c
drivers/mfd/aat2870-core.c
drivers/mfd/lm3533-core.c
drivers/mfd/max8907.c
drivers/mfd/max8925-i2c.c
drivers/mfd/wm8400-core.c
drivers/mfd/wm8994-core.c

index ac4f085..bbc1a87 100644 (file)
@@ -74,7 +74,6 @@ int pm80x_init(struct i2c_client *client)
        chip->irq = client->irq;
 
        chip->dev = &client->dev;
-       dev_set_drvdata(chip->dev, chip);
        i2c_set_clientdata(chip->client, chip);
 
        ret = regmap_read(chip->regmap, PM80X_CHIP_ID, &val);
index aabac37..26d1ffe 100644 (file)
@@ -1166,7 +1166,6 @@ static int pm860x_probe(struct i2c_client *client)
        chip->client = client;
        i2c_set_clientdata(client, chip);
        chip->dev = &client->dev;
-       dev_set_drvdata(chip->dev, chip);
 
        /*
         * Both client and companion client shares same platform driver.
index f253da5..5ff0f1e 100644 (file)
@@ -345,8 +345,6 @@ static int aat2870_i2c_probe(struct i2c_client *client)
                return -ENOMEM;
 
        aat2870->dev = &client->dev;
-       dev_set_drvdata(aat2870->dev, aat2870);
-
        aat2870->client = client;
        i2c_set_clientdata(client, aat2870);
 
index 946f94f..03830aa 100644 (file)
@@ -485,8 +485,6 @@ static int lm3533_device_init(struct lm3533 *lm3533)
 
        lm3533->gpio_hwen = pdata->gpio_hwen;
 
-       dev_set_drvdata(lm3533->dev, lm3533);
-
        if (gpio_is_valid(lm3533->gpio_hwen)) {
                ret = devm_gpio_request_one(lm3533->dev, lm3533->gpio_hwen,
                                        GPIOF_OUT_INIT_LOW, "lm3533-hwen");
index a69b865..0b8f6c2 100644 (file)
@@ -201,8 +201,6 @@ static int max8907_i2c_probe(struct i2c_client *i2c)
        }
 
        max8907->dev = &i2c->dev;
-       dev_set_drvdata(max8907->dev, max8907);
-
        max8907->i2c_gen = i2c;
        i2c_set_clientdata(i2c, max8907);
        max8907->regmap_gen = devm_regmap_init_i2c(i2c,
index 4057fd1..c876100 100644 (file)
@@ -172,7 +172,6 @@ static int max8925_probe(struct i2c_client *client)
        chip->i2c = client;
        chip->dev = &client->dev;
        i2c_set_clientdata(client, chip);
-       dev_set_drvdata(chip->dev, chip);
        mutex_init(&chip->io_lock);
 
        chip->rtc = i2c_new_dummy_device(chip->i2c->adapter, RTC_I2C_ADDR);
index 5e1599a..b572966 100644 (file)
@@ -54,8 +54,6 @@ static int wm8400_init(struct wm8400 *wm8400,
        unsigned int reg;
        int ret;
 
-       dev_set_drvdata(wm8400->dev, wm8400);
-
        /* Check that this is actually a WM8400 */
        ret = regmap_read(wm8400->regmap, WM8400_RESET_ID, &reg);
        if (ret != 0) {
index c419ab0..1b769ac 100644 (file)
@@ -320,8 +320,6 @@ static int wm8994_device_init(struct wm8994 *wm8994, int irq)
        if (ret != 0)
                return ret;
 
-       dev_set_drvdata(wm8994->dev, wm8994);
-
        /* Add the on-chip regulators first for bootstrapping */
        ret = mfd_add_devices(wm8994->dev, 0,
                              wm8994_regulator_devs,