Skip to content

Commit 880d3fc

Browse files
bijudasLinus Walleij
authored andcommitted
pinctrl: mcp23s08_i2c: Extend match support for OF tables
The driver has OF match table, still it uses ID lookup table for retrieving match data. Currently the driver is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using of_device_match_data() if the devices are registered via OF. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20231001150113.7752-2-biju.das.jz@bp.renesas.com Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent 0aa5369 commit 880d3fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/pinctrl/pinctrl-mcp23s08_i2c.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010

1111
static int mcp230xx_probe(struct i2c_client *client)
1212
{
13-
const struct i2c_device_id *id = i2c_client_get_device_id(client);
1413
struct device *dev = &client->dev;
15-
unsigned int type = id->driver_data;
1614
struct mcp23s08 *mcp;
15+
unsigned int type;
1716
int ret;
1817

1918
mcp = devm_kzalloc(dev, sizeof(*mcp), GFP_KERNEL);
2019
if (!mcp)
2120
return -ENOMEM;
2221

22+
type = (uintptr_t)i2c_get_match_data(client);
2323
switch (type) {
2424
case MCP_TYPE_008:
2525
mcp->regmap = devm_regmap_init_i2c(client, &mcp23x08_regmap);

0 commit comments

Comments
 (0)