summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>2020-09-03 21:38:19 +0300
committerMark Brown <broonie@kernel.org>2020-09-04 11:02:38 +0100
commitdf9db2541a82ec18c474942a93729420d37fac81 (patch)
treed61fdc1639605d3f2d8db2c25ae27feece3532c4 /drivers/regulator
parent385d41d7edbc37d6b30197672b744021ce3baccf (diff)
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/bd718x7-regulator.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/regulator/bd718x7-regulator.c b/drivers/regulator/bd718x7-regulator.c
index 7b311389f925..a72031595b9e 100644
--- a/drivers/regulator/bd718x7-regulator.c
+++ b/drivers/regulator/bd718x7-regulator.c
@@ -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++) {
const struct regulator_desc *desc;
@@ -1328,8 +1331,6 @@ static int bd718xx_probe(struct platform_device *pdev)
r = &reg_data[i];
desc = &r->desc;
- config.dev = pdev->dev.parent;
- config.regmap = mfd->chip.regmap;
rdev = devm_regulator_register(&pdev->dev, desc, &config);
if (IS_ERR(rdev)) {