Skip to content

Commit 9aab92b

Browse files
bijudaslag-linaro
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent d92df6f commit 9aab92b

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

drivers/mfd/mc13xxx-i2c.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ static const struct regmap_config mc13xxx_regmap_i2c_config = {
5353

5454
static int mc13xxx_i2c_probe(struct i2c_client *client)
5555
{
56-
const struct i2c_device_id *id = i2c_client_get_device_id(client);
5756
struct mc13xxx *mc13xxx;
5857
int ret;
5958

@@ -73,13 +72,7 @@ static int mc13xxx_i2c_probe(struct i2c_client *client)
7372
return ret;
7473
}
7574

76-
if (client->dev.of_node) {
77-
const struct of_device_id *of_id =
78-
of_match_device(mc13xxx_dt_ids, &client->dev);
79-
mc13xxx->variant = of_id->data;
80-
} else {
81-
mc13xxx->variant = (void *)id->driver_data;
82-
}
75+
mc13xxx->variant = i2c_get_match_data(client);
8376

8477
return mc13xxx_common_init(&client->dev);
8578
}

0 commit comments

Comments
 (0)