aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2011-05-05 11:32:58 -0400
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-05-27 05:34:37 -0400
commitba413c5972676295862797a46f9070f81691d80e (patch)
treea1cf36dc1c812a54e1f7eb480eb1032516c3b012
parent82d158397b6eeb464263a6ef6a739c4118a34720 (diff)
regulator: Move VCOINCELL to be the last element of mc13892_regulators array
In include/linux/mfd/mc13892.h, we define MC13892_VCOINCELL as 23. Thus VCOINCELL should be defined as 23th element in mc13892_regulators array, not the first one. This actually fixes an off-by-one bug while accessing mc13892_regulators array. For example, In mc13892_regulator_probe, we use MC13892_VCAM as array index of mc13892_regulators array. mc13892_regulators[MC13892_VCAM].desc.ops->set_mode = mc13892_vcam_set_mode; Currently, it access mc13892_regulators[12] ,which is VAUDIO not VCAM. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r--drivers/regulator/mc13892-regulator.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
index 1b8f7398a4a8..ba909cb0d2b8 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -259,7 +259,6 @@ static struct regulator_ops mc13892_sw_regulator_ops;
259 mc13xxx_regulator_ops) 259 mc13xxx_regulator_ops)
260 260
261static struct mc13xxx_regulator mc13892_regulators[] = { 261static struct mc13xxx_regulator mc13892_regulators[] = {
262 MC13892_DEFINE_REGU(VCOINCELL, POWERCTL0, POWERCTL0, mc13892_vcoincell),
263 MC13892_SW_DEFINE(SW1, SWITCHERS0, SWITCHERS0, mc13892_sw1), 262 MC13892_SW_DEFINE(SW1, SWITCHERS0, SWITCHERS0, mc13892_sw1),
264 MC13892_SW_DEFINE(SW2, SWITCHERS1, SWITCHERS1, mc13892_sw), 263 MC13892_SW_DEFINE(SW2, SWITCHERS1, SWITCHERS1, mc13892_sw),
265 MC13892_SW_DEFINE(SW3, SWITCHERS2, SWITCHERS2, mc13892_sw), 264 MC13892_SW_DEFINE(SW3, SWITCHERS2, SWITCHERS2, mc13892_sw),
@@ -293,6 +292,7 @@ static struct mc13xxx_regulator mc13892_regulators[] = {
293 MC13892_GPO_DEFINE(GPO4, POWERMISC, mc13892_gpo), 292 MC13892_GPO_DEFINE(GPO4, POWERMISC, mc13892_gpo),
294 MC13892_GPO_DEFINE(PWGT1SPI, POWERMISC, mc13892_pwgtdrv), 293 MC13892_GPO_DEFINE(PWGT1SPI, POWERMISC, mc13892_pwgtdrv),
295 MC13892_GPO_DEFINE(PWGT2SPI, POWERMISC, mc13892_pwgtdrv), 294 MC13892_GPO_DEFINE(PWGT2SPI, POWERMISC, mc13892_pwgtdrv),
295 MC13892_DEFINE_REGU(VCOINCELL, POWERCTL0, POWERCTL0, mc13892_vcoincell),
296}; 296};
297 297
298static int mc13892_powermisc_rmw(struct mc13xxx_regulator_priv *priv, u32 mask, 298static int mc13892_powermisc_rmw(struct mc13xxx_regulator_priv *priv, u32 mask,