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

Configure Feed

Select the types of activity you want to include in your feed.

regulator: mp5416: 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, remove trailing comma in the terminator entry for OF/ID
table and drop a space from terminator entry for ID table.

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

authored by

Biju Das and committed by
Mark Brown
969b033a 9d9cd8e6

+5 -5
+5 -5
drivers/regulator/mp5416.c
··· 200 200 return PTR_ERR(regmap); 201 201 } 202 202 203 - desc = of_device_get_match_data(dev); 203 + desc = i2c_get_match_data(client); 204 204 if (!desc) 205 205 return -ENODEV; 206 206 ··· 223 223 static const struct of_device_id mp5416_of_match[] = { 224 224 { .compatible = "mps,mp5416", .data = &mp5416_regulators_desc }, 225 225 { .compatible = "mps,mp5496", .data = &mp5496_regulators_desc }, 226 - {}, 226 + {} 227 227 }; 228 228 MODULE_DEVICE_TABLE(of, mp5416_of_match); 229 229 230 230 static const struct i2c_device_id mp5416_id[] = { 231 - { "mp5416", }, 232 - { "mp5496", }, 233 - { }, 231 + { "mp5416", (kernel_ulong_t)&mp5416_regulators_desc }, 232 + { "mp5496", (kernel_ulong_t)&mp5496_regulators_desc }, 233 + {} 234 234 }; 235 235 MODULE_DEVICE_TABLE(i2c, mp5416_id); 236 236