summaryrefslogtreecommitdiff
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2016-03-21 05:29:45 +0300
committerMark Brown <broonie@kernel.org>2016-03-21 16:35:30 +0300
commit95a293c7ba17253b8cffcacbdd716ebfbfe42587 (patch)
tree4dbb667395c24e3eb1adde35295dc497b270a351 /drivers/regulator/core.c
parent768e66686cfe83f786f6ae26f1799cca69e80523 (diff)
downloadlinux-95a293c7ba17253b8cffcacbdd716ebfbfe42587.tar.xz
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 <javier@osg.samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index e0b764284773..6dd63523bcfe 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1532,7 +1532,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);