]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
regulator: Remove unneded check for regulator supply
authorJavier Martinez Canillas <javier@osg.samsung.com>
Mon, 21 Mar 2016 02:29:45 +0000 (23:29 -0300)
committerMark Brown <broonie@kernel.org>
Mon, 21 Mar 2016 13:35:30 +0000 (13:35 +0000)
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>
drivers/regulator/core.c

index e0b7642847731390ed44bbc3e8718fd5dd9e7116..6dd63523bcfe4f1f105c42f61fd2ab5cd504ed94 100644 (file)
@@ -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);