Skip to content

Commit

Permalink
regulator: core: Don't open code _regulator_is_enabled()
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
  • Loading branch information
Mark Brown committed May 14, 2012
1 parent f0b067d commit b1a8683
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3160,8 +3160,7 @@ regulator_register(const struct regulator_desc *regulator_desc,
goto scrub;

/* Enable supply if rail is enabled */
if (rdev->desc->ops->is_enabled &&
rdev->desc->ops->is_enabled(rdev)) {
if (_regulator_is_enabled(rdev)) {
ret = regulator_enable(rdev->supply);
if (ret < 0)
goto scrub;
Expand Down Expand Up @@ -3293,7 +3292,7 @@ int regulator_suspend_finish(void)
goto unlock;
if (!ops->disable)
goto unlock;
if (ops->is_enabled && !ops->is_enabled(rdev))
if (!_regulator_is_enabled(rdev))
goto unlock;

error = ops->disable(rdev);
Expand Down

0 comments on commit b1a8683

Please sign in to comment.