diff options
author | Biju Das <biju.das.jz@bp.renesas.com> | 2023-08-26 20:38:41 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2023-09-11 03:31:26 +0300 |
commit | 9e38482cb562f03fe8d521a001d44eba176a9201 (patch) | |
tree | 9872d519a4df5a9c591f9dadaef178464503923c /drivers/regulator | |
parent | 7169654ce0f754679c60a6e2f904f6f19e54bad1 (diff) | |
download | linux-9e38482cb562f03fe8d521a001d44eba176a9201.tar.xz |
regulator: mp886x: 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.
Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20230826173841.91807-1-biju.das.jz@bp.renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/mp886x.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/regulator/mp886x.c b/drivers/regulator/mp886x.c index 9911be2e6bac..48dcee5287f3 100644 --- a/drivers/regulator/mp886x.c +++ b/drivers/regulator/mp886x.c @@ -315,7 +315,7 @@ static int mp886x_i2c_probe(struct i2c_client *client) if (IS_ERR(di->en_gpio)) return PTR_ERR(di->en_gpio); - di->ci = of_device_get_match_data(dev); + di->ci = i2c_get_match_data(client); di->dev = dev; regmap = devm_regmap_init_i2c(client, &mp886x_regmap_config); @@ -341,20 +341,14 @@ static int mp886x_i2c_probe(struct i2c_client *client) } static const struct of_device_id mp886x_dt_ids[] = { - { - .compatible = "mps,mp8867", - .data = &mp8867_ci - }, - { - .compatible = "mps,mp8869", - .data = &mp8869_ci - }, + { .compatible = "mps,mp8867", .data = &mp8867_ci }, + { .compatible = "mps,mp8869", .data = &mp8869_ci }, { } }; MODULE_DEVICE_TABLE(of, mp886x_dt_ids); static const struct i2c_device_id mp886x_id[] = { - { "mp886x", }, + { "mp886x", (kernel_ulong_t)&mp8869_ci }, { }, }; MODULE_DEVICE_TABLE(i2c, mp886x_id); |