power: supply: bq27xxx: Convert to i2c's .probe_new()
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 18 Nov 2022 22:44:16 +0000 (23:44 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sun, 20 Nov 2022 19:12:16 +0000 (20:12 +0100)
.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq27xxx_battery_i2c.c

index 94b00bb89c177fe80df9c7a8465a10419192e744..f8768997333bc59412d040cee7427efad086a7f2 100644 (file)
@@ -136,9 +136,9 @@ static int bq27xxx_battery_i2c_bulk_write(struct bq27xxx_device_info *di,
        return 0;
 }
 
-static int bq27xxx_battery_i2c_probe(struct i2c_client *client,
-                                    const struct i2c_device_id *id)
+static int bq27xxx_battery_i2c_probe(struct i2c_client *client)
 {
+       const struct i2c_device_id *id = i2c_client_get_device_id(client);
        struct bq27xxx_device_info *di;
        int ret;
        char *name;
@@ -295,7 +295,7 @@ static struct i2c_driver bq27xxx_battery_i2c_driver = {
                .name = "bq27xxx-battery",
                .of_match_table = of_match_ptr(bq27xxx_battery_i2c_of_match_table),
        },
-       .probe = bq27xxx_battery_i2c_probe,
+       .probe_new = bq27xxx_battery_i2c_probe,
        .remove = bq27xxx_battery_i2c_remove,
        .id_table = bq27xxx_i2c_id_table,
 };