From: Danny Huang Date: Wed, 1 Dec 2010 20:37:30 +0000 (-0700) Subject: regulator: tps6586x: Handle both enable reg/bits being the same X-Git-Tag: firefly_0821_release~9833^2~93^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e1f65c5ad751d29227bc44f2c0a95fa0b4505f4b;p=firefly-linux-kernel-4.4.55.git regulator: tps6586x: Handle both enable reg/bits being the same Change-Id: I40400bb65eab496bb1becd26b37a9653b99d4f41 Signed-off-by: Danny Huang Signed-off-by: Olof Johansson Signed-off-by: Stephen Warren Acked-by: Mark Brown (Split into separate patches) Signed-off-by: Liam Girdwood --- diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c index f8c0b1b0685c..6d20b0454a1d 100644 --- a/drivers/regulator/tps6586x-regulator.c +++ b/drivers/regulator/tps6586x-regulator.c @@ -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;