Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Biju Das and committed by
Lee Jones
9aab92bc d92df6fb

+1 -8
+1 -8
drivers/mfd/mc13xxx-i2c.c
··· 53 53 54 54 static int mc13xxx_i2c_probe(struct i2c_client *client) 55 55 { 56 - const struct i2c_device_id *id = i2c_client_get_device_id(client); 57 56 struct mc13xxx *mc13xxx; 58 57 int ret; 59 58 ··· 72 73 return ret; 73 74 } 74 75 75 - if (client->dev.of_node) { 76 - const struct of_device_id *of_id = 77 - of_match_device(mc13xxx_dt_ids, &client->dev); 78 - mc13xxx->variant = of_id->data; 79 - } else { 80 - mc13xxx->variant = (void *)id->driver_data; 81 - } 76 + mc13xxx->variant = i2c_get_match_data(client); 82 77 83 78 return mc13xxx_common_init(&client->dev); 84 79 }