1

pinctrl: cy8c95x0: Simplify probe()

Simpilfy probe() by replacing device_get_match_data() and ID lookup for
retrieving match data by i2c_get_match_data().

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/20230902082225.8777-1-biju.das.jz@bp.renesas.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
Biju Das 2023-09-02 09:22:25 +01:00 committed by Linus Walleij
parent 68a2f05fec
commit 71567fbd1d

View File

@ -1346,9 +1346,7 @@ static int cy8c95x0_probe(struct i2c_client *client)
chip->dev = &client->dev;
/* Set the device type */
chip->driver_data = (unsigned long)device_get_match_data(&client->dev);
if (!chip->driver_data)
chip->driver_data = i2c_match_id(cy8c95x0_id, client)->driver_data;
chip->driver_data = (uintptr_t)i2c_get_match_data(client);
if (!chip->driver_data)
return -ENODEV;