From: Javier Martinez Canillas Date: Mon, 21 Mar 2016 02:29:45 +0000 (-0300) Subject: UPSTREAM: regulator: Remove unneded check for regulator supply X-Git-Tag: firefly_0821_release~476 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=98543f90ac4fde45e5d848ada75cc0e450df9757;p=firefly-linux-kernel-4.4.55.git UPSTREAM: regulator: Remove unneded check for regulator supply The regulator_resolve_supply() function checks if a supply has been associated with a regulator to avoid enabling it if that is not the case. But the supply was already looked up with regulator_resolve_supply() and set with set_supply() before the check and both return on error. So the fact that this statement has been reached means that neither of them failed and a supply must be associated with the regulator. Signed-off-by: Javier Martinez Canillas Signed-off-by: Mark Brown (cherry picked from commit 95a293c7ba17253b8cffcacbdd716ebfbfe42587) Change-Id: Ib4738ae3f733256a2ba794543430ffde2c434352 Signed-off-by: David Wu --- diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index a03d79907074..f28fca4b68e3 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -1530,7 +1530,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) } /* Cascade always-on state to supply */ - if (_regulator_is_enabled(rdev) && rdev->supply) { + if (_regulator_is_enabled(rdev)) { ret = regulator_enable(rdev->supply); if (ret < 0) { _regulator_put(rdev->supply);