summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/mc13xxx-i2c.c
diff options
context:
space:
mode:
authorBiju Das <biju.das.jz@bp.renesas.com>2023-08-19 20:31:55 +0200
committerLee Jones <lee@kernel.org>2023-08-22 09:07:52 +0200
commit9aab92bc3a8922d4b2e24d10271dfe3034cbf5c2 (patch)
treeac6f2763b06fb1f76b6a994e5df46620eeace4b6 /drivers/mfd/mc13xxx-i2c.c
parentmfd: rz-mtu3: Replace raw_spin_lock->spin_lock() (diff)
downloadlinux-9aab92bc3a8922d4b2e24d10271dfe3034cbf5c2.tar.xz
linux-9aab92bc3a8922d4b2e24d10271dfe3034cbf5c2.zip
mfd: mc13xxx: Simplify device data fetching in probe()
Simplify probe() by replacing of_match_device() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Link: https://lore.kernel.org/r/20230819183155.22335-1-biju.das.jz@bp.renesas.com Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'drivers/mfd/mc13xxx-i2c.c')
-rw-r--r--drivers/mfd/mc13xxx-i2c.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c
index de59b498c925..6bc0e755ba34 100644
--- a/drivers/mfd/mc13xxx-i2c.c
+++ b/drivers/mfd/mc13xxx-i2c.c
@@ -53,7 +53,6 @@ static const struct regmap_config mc13xxx_regmap_i2c_config = {
static int mc13xxx_i2c_probe(struct i2c_client *client)
{
- const struct i2c_device_id *id = i2c_client_get_device_id(client);
struct mc13xxx *mc13xxx;
int ret;
@@ -73,13 +72,7 @@ static int mc13xxx_i2c_probe(struct i2c_client *client)
return ret;
}
- if (client->dev.of_node) {
- const struct of_device_id *of_id =
- of_match_device(mc13xxx_dt_ids, &client->dev);
- mc13xxx->variant = of_id->data;
- } else {
- mc13xxx->variant = (void *)id->driver_data;
- }
+ mc13xxx->variant = i2c_get_match_data(client);
return mc13xxx_common_init(&client->dev);
}