aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/regulator/max8907-regulator.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c
index ed90c759c231..9623e9e290bf 100644
--- a/drivers/regulator/max8907-regulator.c
+++ b/drivers/regulator/max8907-regulator.c
@@ -34,7 +34,6 @@
34 34
35struct max8907_regulator { 35struct max8907_regulator {
36 struct regulator_desc desc[MAX8907_NUM_REGULATORS]; 36 struct regulator_desc desc[MAX8907_NUM_REGULATORS];
37 struct regulator_dev *rdev[MAX8907_NUM_REGULATORS];
38}; 37};
39 38
40#define REG_MBATT() \ 39#define REG_MBATT() \
@@ -310,6 +309,8 @@ static int max8907_regulator_probe(struct platform_device *pdev)
310 } 309 }
311 310
312 for (i = 0; i < MAX8907_NUM_REGULATORS; i++) { 311 for (i = 0; i < MAX8907_NUM_REGULATORS; i++) {
312 struct regulator_dev *rdev;
313
313 config.dev = pdev->dev.parent; 314 config.dev = pdev->dev.parent;
314 if (pdata) 315 if (pdata)
315 idata = pdata->init_data[i]; 316 idata = pdata->init_data[i];
@@ -349,13 +350,13 @@ static int max8907_regulator_probe(struct platform_device *pdev)
349 pmic->desc[i].ops = &max8907_out5v_hwctl_ops; 350 pmic->desc[i].ops = &max8907_out5v_hwctl_ops;
350 } 351 }
351 352
352 pmic->rdev[i] = devm_regulator_register(&pdev->dev, 353 rdev = devm_regulator_register(&pdev->dev,
353 &pmic->desc[i], &config); 354 &pmic->desc[i], &config);
354 if (IS_ERR(pmic->rdev[i])) { 355 if (IS_ERR(rdev)) {
355 dev_err(&pdev->dev, 356 dev_err(&pdev->dev,
356 "failed to register %s regulator\n", 357 "failed to register %s regulator\n",
357 pmic->desc[i].name); 358 pmic->desc[i].name);
358 return PTR_ERR(pmic->rdev[i]); 359 return PTR_ERR(rdev);
359 } 360 }
360 } 361 }
361 362