mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-05 10:06:48 +07:00
regulator: bd718x7 initialize regulator config only once
The BD718x7 driver initialized common configs for all regulators. Simplify initialization by moving the initialization of common configs out of the loop. Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> Link: https://lore.kernel.org/r/2d3e68c94d4813410da8c4c7eac3332d167d19a8.1599029334.git.matti.vaittinen@fi.rohmeurope.com Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
385d41d7ed
commit
df9db2541a
@ -1319,6 +1319,9 @@ static int bd718xx_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config.dev = pdev->dev.parent;
|
||||||
|
config.regmap = mfd->chip.regmap;
|
||||||
|
|
||||||
for (i = 0; i < num_reg_data; i++) {
|
for (i = 0; i < num_reg_data; i++) {
|
||||||
|
|
||||||
const struct regulator_desc *desc;
|
const struct regulator_desc *desc;
|
||||||
@ -1328,8 +1331,6 @@ static int bd718xx_probe(struct platform_device *pdev)
|
|||||||
r = ®_data[i];
|
r = ®_data[i];
|
||||||
desc = &r->desc;
|
desc = &r->desc;
|
||||||
|
|
||||||
config.dev = pdev->dev.parent;
|
|
||||||
config.regmap = mfd->chip.regmap;
|
|
||||||
|
|
||||||
rdev = devm_regulator_register(&pdev->dev, desc, &config);
|
rdev = devm_regulator_register(&pdev->dev, desc, &config);
|
||||||
if (IS_ERR(rdev)) {
|
if (IS_ERR(rdev)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user