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:
Matti Vaittinen 2020-09-03 21:38:19 +03:00 committed by Mark Brown
parent 385d41d7ed
commit df9db2541a
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0

View File

@ -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 = &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)) {