]> git.karo-electronics.de Git - karo-tx-linux.git/commit
regulator: Move VCOINCELL to be the last element of mc13892_regulators array
authorAxel Lin <axel.lin@gmail.com>
Thu, 5 May 2011 15:32:58 +0000 (23:32 +0800)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Fri, 27 May 2011 09:34:37 +0000 (10:34 +0100)
commitba413c5972676295862797a46f9070f81691d80e
treea1cf36dc1c812a54e1f7eb480eb1032516c3b012
parent82d158397b6eeb464263a6ef6a739c4118a34720
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>
drivers/regulator/mc13892-regulator.c