Commit df9db254 authored by Matti Vaittinen's avatar Matti Vaittinen Committed by Mark Brown

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: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Link: https://lore.kernel.org/r/2d3e68c94d4813410da8c4c7eac3332d167d19a8.1599029334.git.matti.vaittinen@fi.rohmeurope.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 385d41d7
...@@ -1319,6 +1319,9 @@ static int bd718xx_probe(struct platform_device *pdev) ...@@ -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) ...@@ -1328,8 +1331,6 @@ static int bd718xx_probe(struct platform_device *pdev)
r = &reg_data[i]; r = &reg_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)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment