diff mbox series

[RFC,2/4] i2c: mux: ltc4306: convert to using a pointer in i2c_device_id

Message ID 20230814-i2c-id-rework-v1-2-3e5bc71c49ee@gmail.com
State New
Headers show
Series Start unification of of_device_id and i2c_device_id | expand

Commit Message

Dmitry Torokhov Aug. 14, 2023, 9:52 p.m. UTC
Switch the driver to use newly added "data" pointer in i2c_device_id to
streamline DT and legacy flows.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/i2c/muxes/i2c-mux-ltc4306.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/i2c/muxes/i2c-mux-ltc4306.c b/drivers/i2c/muxes/i2c-mux-ltc4306.c
index 637e25506490..17b9ed9ceef3 100644
--- a/drivers/i2c/muxes/i2c-mux-ltc4306.c
+++ b/drivers/i2c/muxes/i2c-mux-ltc4306.c
@@ -192,8 +192,8 @@  static int ltc4306_deselect_mux(struct i2c_mux_core *muxc, u32 chan)
 }
 
 static const struct i2c_device_id ltc4306_id[] = {
-	{ "ltc4305", ltc_4305 },
-	{ "ltc4306", ltc_4306 },
+	{ "ltc4305", .data = &chips[ltc_4305] },
+	{ "ltc4306", .data = &chips[ltc_4306] },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, ltc4306_id);
@@ -217,9 +217,8 @@  static int ltc4306_probe(struct i2c_client *client)
 	int num, ret;
 
 	chip = of_device_get_match_data(&client->dev);
-
 	if (!chip)
-		chip = &chips[i2c_match_id(ltc4306_id, client)->driver_data];
+		chip = i2c_match_id(ltc4306_id, client)->data;
 
 	idle_disc = device_property_read_bool(&client->dev,
 					      "i2c-mux-idle-disconnect");