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

regulator: sy8824x: 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
driver_data is wrong for ID match.

While at it, drop trailing comma in the terminator entry from ID
table.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230828165447.106058-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Biju Das and committed by
Mark Brown
24d95bb0 364a399b

+7 -19
+7 -19
drivers/regulator/sy8824x.c
··· 142 142 } 143 143 144 144 di->dev = dev; 145 - di->cfg = of_device_get_match_data(dev); 145 + di->cfg = i2c_get_match_data(client); 146 146 147 147 regmap = devm_regmap_init_i2c(client, di->cfg->config); 148 148 if (IS_ERR(regmap)) { ··· 204 204 }; 205 205 206 206 static const struct of_device_id sy8824_dt_ids[] = { 207 - { 208 - .compatible = "silergy,sy8824c", 209 - .data = &sy8824c_cfg 210 - }, 211 - { 212 - .compatible = "silergy,sy8824e", 213 - .data = &sy8824e_cfg 214 - }, 215 - { 216 - .compatible = "silergy,sy20276", 217 - .data = &sy20276_cfg 218 - }, 219 - { 220 - .compatible = "silergy,sy20278", 221 - .data = &sy20278_cfg 222 - }, 207 + { .compatible = "silergy,sy8824c", .data = &sy8824c_cfg }, 208 + { .compatible = "silergy,sy8824e", .data = &sy8824e_cfg }, 209 + { .compatible = "silergy,sy20276", .data = &sy20276_cfg }, 210 + { .compatible = "silergy,sy20278", .data = &sy20278_cfg }, 223 211 { } 224 212 }; 225 213 MODULE_DEVICE_TABLE(of, sy8824_dt_ids); 226 214 227 215 static const struct i2c_device_id sy8824_id[] = { 228 - { "sy8824", }, 229 - { }, 216 + { "sy8824", (kernel_ulong_t)&sy8824c_cfg }, 217 + { } 230 218 }; 231 219 MODULE_DEVICE_TABLE(i2c, sy8824_id); 232 220