Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

power: supply: sbs-battery: Make similar OF and ID table

Make similar OF and ID table to extend support for ID match
using i2c_match_data(). Currently it works only for OF match
tables as the field is wrong for ID match.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230831171235.58477-1-biju.das.jz@bp.renesas.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Biju Das and committed by
Sebastian Reichel
a7d79bcc 02e673e5

+4 -4
+4 -4
drivers/power/supply/sbs-battery.c
··· 1135 1135 if (!chip) 1136 1136 return -ENOMEM; 1137 1137 1138 - chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev); 1138 + chip->flags = (uintptr_t)i2c_get_match_data(client); 1139 1139 chip->client = client; 1140 1140 psy_cfg.of_node = client->dev.of_node; 1141 1141 psy_cfg.drv_data = chip; ··· 1253 1253 #endif 1254 1254 1255 1255 static const struct i2c_device_id sbs_id[] = { 1256 - { "bq20z65", 0 }, 1257 - { "bq20z75", 0 }, 1258 - { "sbs-battery", 1 }, 1256 + { "bq20z65", SBS_FLAGS_TI_BQ20ZX5 }, 1257 + { "bq20z75", SBS_FLAGS_TI_BQ20ZX5 }, 1258 + { "sbs-battery", 0 }, 1259 1259 {} 1260 1260 }; 1261 1261 MODULE_DEVICE_TABLE(i2c, sbs_id);