regulator: tps6586x: Handle both enable reg/bits being the same
authorDanny Huang <dahuang@nvidia.com>
Wed, 1 Dec 2010 20:37:30 +0000 (13:37 -0700)
committerLiam Girdwood <lrg@slimlogic.co.uk>
Thu, 9 Dec 2010 09:23:43 +0000 (09:23 +0000)
Change-Id: I40400bb65eab496bb1becd26b37a9653b99d4f41
Signed-off-by: Danny Huang <dahuang@nvidia.com>
Signed-off-by: Olof Johansson <olofj@chromium.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  (Split into separate patches)
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
drivers/regulator/tps6586x-regulator.c

index effa6770ead32c4681775b43cbc73ab3eaf0a238..c668944dc3ad80fa9f51fa8cb16976a4ae16eaf9 100644 (file)
@@ -297,6 +297,10 @@ static inline int tps6586x_regulator_preinit(struct device *parent,
        uint8_t val1, val2;
        int ret;
 
+       if (ri->enable_reg[0] == ri->enable_reg[1] &&
+           ri->enable_bit[0] == ri->enable_bit[1])
+                       return 0;
+
        ret = tps6586x_read(parent, ri->enable_reg[0], &val1);
        if (ret)
                return ret;