aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max77686.c
diff options
context:
space:
mode:
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>2014-11-04 03:49:41 -0500
committerMark Brown <broonie@kernel.org>2014-11-04 15:41:28 -0500
commiteca29da9a2e832936c9077b8e69adb4f4b22b0d5 (patch)
tree302b334e339687b8182a7f76dfef0fd5ba61a807 /drivers/regulator/max77686.c
parent78ce612860ce80edbec9171b4a786ce131a9631c (diff)
regulator: max77686: Consistently index opmode array by rdev id
Mixed indexes were used for array of opmodes in max77686_data structure: id of regulator and index of regulator_desc array. These indexes are exactly the same but the mixture may confuse. Use consistently the id of regulator. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/max77686.c')
-rw-r--r--drivers/regulator/max77686.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c
index 09b0d8c20a9d..27c5f4556044 100644
--- a/drivers/regulator/max77686.c
+++ b/drivers/regulator/max77686.c
@@ -82,6 +82,7 @@ enum max77686_ramp_rate {
82}; 82};
83 83
84struct max77686_data { 84struct max77686_data {
85 /* Array indexed by regulator id */
85 unsigned int opmode[MAX77686_REGULATORS]; 86 unsigned int opmode[MAX77686_REGULATORS];
86}; 87};
87 88
@@ -513,12 +514,13 @@ static int max77686_pmic_probe(struct platform_device *pdev)
513 514
514 for (i = 0; i < MAX77686_REGULATORS; i++) { 515 for (i = 0; i < MAX77686_REGULATORS; i++) {
515 struct regulator_dev *rdev; 516 struct regulator_dev *rdev;
517 int id = regulators[i].id;
516 518
517 config.init_data = pdata->regulators[i].initdata; 519 config.init_data = pdata->regulators[i].initdata;
518 config.of_node = pdata->regulators[i].of_node; 520 config.of_node = pdata->regulators[i].of_node;
519 521
520 max77686->opmode[i] = regulators[i].enable_mask >> 522 max77686->opmode[id] = regulators[i].enable_mask >>
521 max77686_get_opmode_shift(i); 523 max77686_get_opmode_shift(id);
522 rdev = devm_regulator_register(&pdev->dev, 524 rdev = devm_regulator_register(&pdev->dev,
523 &regulators[i], &config); 525 &regulators[i], &config);
524 if (IS_ERR(rdev)) { 526 if (IS_ERR(rdev)) {