Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: max8907: Remove regulator_dev array from state container

Don't store array of regulator_dev returned by devm_regulator_register()
in state container. It isn't used anywhere outside of
max8907_regulator_probe() function.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Mark Brown <broonie@linaro.org>

authored by

Krzysztof Kozlowski and committed by
Mark Brown
f991525a d016bdc7

+5 -4
+5 -4
drivers/regulator/max8907-regulator.c
··· 34 34 35 35 struct max8907_regulator { 36 36 struct regulator_desc desc[MAX8907_NUM_REGULATORS]; 37 - struct regulator_dev *rdev[MAX8907_NUM_REGULATORS]; 38 37 }; 39 38 40 39 #define REG_MBATT() \ ··· 309 310 } 310 311 311 312 for (i = 0; i < MAX8907_NUM_REGULATORS; i++) { 313 + struct regulator_dev *rdev; 314 + 312 315 config.dev = pdev->dev.parent; 313 316 if (pdata) 314 317 idata = pdata->init_data[i]; ··· 350 349 pmic->desc[i].ops = &max8907_out5v_hwctl_ops; 351 350 } 352 351 353 - pmic->rdev[i] = devm_regulator_register(&pdev->dev, 352 + rdev = devm_regulator_register(&pdev->dev, 354 353 &pmic->desc[i], &config); 355 - if (IS_ERR(pmic->rdev[i])) { 354 + if (IS_ERR(rdev)) { 356 355 dev_err(&pdev->dev, 357 356 "failed to register %s regulator\n", 358 357 pmic->desc[i].name); 359 - return PTR_ERR(pmic->rdev[i]); 358 + return PTR_ERR(rdev); 360 359 } 361 360 } 362 361