[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230814-i2c-id-rework-v1-2-3e5bc71c49ee@gmail.com>
Date: Mon, 14 Aug 2023 14:52:50 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Wolfram Sang <wsa@...nel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Andi Shyti <andi.shyti@...nel.org>,
Biju Das <biju.das.jz@...renesas.com>,
Jonathan Cameron <jic23@...nel.org>,
Michael Hennerich <michael.hennerich@...log.com>,
Peter Rosin <peda@...ntia.se>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH RFC 2/4] i2c: mux: ltc4306: convert to using a pointer in i2c_device_id
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@...il.com>
---
drivers/i2c/muxes/i2c-mux-ltc4306.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
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");
--
2.41.0.694.ge786442a9b-goog
Powered by blists - more mailing lists