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

regulator: max77686: 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
max77686_pmic_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
b0c13e80 7c2ee82c

+5 -4
+5 -4
drivers/regulator/max77686.c
··· 65 65 }; 66 66 67 67 struct max77686_data { 68 - struct regulator_dev *rdev[MAX77686_REGULATORS]; 69 68 unsigned int opmode[MAX77686_REGULATORS]; 70 69 }; 71 70 ··· 473 474 platform_set_drvdata(pdev, max77686); 474 475 475 476 for (i = 0; i < MAX77686_REGULATORS; i++) { 477 + struct regulator_dev *rdev; 478 + 476 479 config.init_data = pdata->regulators[i].initdata; 477 480 config.of_node = pdata->regulators[i].of_node; 478 481 479 482 max77686->opmode[i] = regulators[i].enable_mask; 480 - max77686->rdev[i] = devm_regulator_register(&pdev->dev, 483 + rdev = devm_regulator_register(&pdev->dev, 481 484 &regulators[i], &config); 482 - if (IS_ERR(max77686->rdev[i])) { 485 + if (IS_ERR(rdev)) { 483 486 dev_err(&pdev->dev, 484 487 "regulator init failed for %d\n", i); 485 - return PTR_ERR(max77686->rdev[i]); 488 + return PTR_ERR(rdev); 486 489 } 487 490 } 488 491