From: Guiting Shen <aarongt.shen@gmail.com>
To: lee@kernel.org
Cc: linux-kernel@vger.kernel.org, patches@opensource.cirrus.com,
Guiting Shen <aarongt.shen@gmail.com>,
Johan Hovold <johan@kernel.org>
Subject: [PATCH v2 RESEND] mfd: remove redundant dev_set_drvdata() from i2c drivers
Date: Tue, 25 Apr 2023 10:45:26 +0800 [thread overview]
Message-ID: <20230425024526.6443-1-aarongt.shen@gmail.com> (raw)
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>
---
drivers/mfd/88pm80x.c | 1 -
drivers/mfd/88pm860x-core.c | 1 -
drivers/mfd/aat2870-core.c | 2 --
drivers/mfd/lm3533-core.c | 2 --
drivers/mfd/max8907.c | 2 --
drivers/mfd/max8925-i2c.c | 1 -
drivers/mfd/wm8400-core.c | 2 --
drivers/mfd/wm8994-core.c | 2 --
8 files changed, 13 deletions(-)
diff --git a/drivers/mfd/88pm80x.c b/drivers/mfd/88pm80x.c
index ac4f08565f29..bbc1a87f0c8f 100644
--- a/drivers/mfd/88pm80x.c
+++ b/drivers/mfd/88pm80x.c
@@ -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);
diff --git a/drivers/mfd/88pm860x-core.c b/drivers/mfd/88pm860x-core.c
index aabac37c3502..26d1ffefadc1 100644
--- a/drivers/mfd/88pm860x-core.c
+++ b/drivers/mfd/88pm860x-core.c
@@ -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.
diff --git a/drivers/mfd/aat2870-core.c b/drivers/mfd/aat2870-core.c
index f253da5b246b..5ff0f1ed7a15 100644
--- a/drivers/mfd/aat2870-core.c
+++ b/drivers/mfd/aat2870-core.c
@@ -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);
diff --git a/drivers/mfd/lm3533-core.c b/drivers/mfd/lm3533-core.c
index 946f94f3a3c3..03830aa4979a 100644
--- a/drivers/mfd/lm3533-core.c
+++ b/drivers/mfd/lm3533-core.c
@@ -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");
diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c
index a69b865c6eac..0b8f6c298f97 100644
--- a/drivers/mfd/max8907.c
+++ b/drivers/mfd/max8907.c
@@ -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,
diff --git a/drivers/mfd/max8925-i2c.c b/drivers/mfd/max8925-i2c.c
index 4057fd15c29e..c8761003c716 100644
--- a/drivers/mfd/max8925-i2c.c
+++ b/drivers/mfd/max8925-i2c.c
@@ -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);
diff --git a/drivers/mfd/wm8400-core.c b/drivers/mfd/wm8400-core.c
index 5e1599ac9abc..b572966e1ff6 100644
--- a/drivers/mfd/wm8400-core.c
+++ b/drivers/mfd/wm8400-core.c
@@ -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, ®);
if (ret != 0) {
diff --git a/drivers/mfd/wm8994-core.c b/drivers/mfd/wm8994-core.c
index c419ab0c0eae..1b769ac3e53b 100644
--- a/drivers/mfd/wm8994-core.c
+++ b/drivers/mfd/wm8994-core.c
@@ -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,
--
2.34.1
next reply other threads:[~2023-04-25 2:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-25 2:45 Guiting Shen [this message]
2023-04-25 11:30 ` Charles Keepax
2023-04-27 16:59 ` Lee Jones
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230425024526.6443-1-aarongt.shen@gmail.com \
--to=aarongt.shen@gmail.com \
--cc=johan@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®