瀏覽代碼

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>
Javier Martinez Canillas 9 年之前
父節點
當前提交
95a293c7ba
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/regulator/core.c

+ 1 - 1
drivers/regulator/core.c

@@ -1532,7 +1532,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)
 	}
 	}
 
 
 	/* Cascade always-on state to supply */
 	/* Cascade always-on state to supply */
-	if (_regulator_is_enabled(rdev) && rdev->supply) {
+	if (_regulator_is_enabled(rdev)) {
 		ret = regulator_enable(rdev->supply);
 		ret = regulator_enable(rdev->supply);
 		if (ret < 0) {
 		if (ret < 0) {
 			_regulator_put(rdev->supply);
 			_regulator_put(rdev->supply);