Skip to content

Commit c088a49

Browse files
peter50216broonie
authored andcommitted
regulator: core: don't disable regulator if is_enabled return error.
In regulator_late_cleanup when is_enabled failed, don't try to disable the regulator since it would likely to fail too and causing confusing error messages. Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Link: https://lore.kernel.org/r/20201106064817.3290927-1-pihsun@chromium.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent cf1ad55 commit c088a49

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/regulator/core.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5843,13 +5843,14 @@ static int regulator_late_cleanup(struct device *dev, void *data)
58435843
if (rdev->use_count)
58445844
goto unlock;
58455845

5846-
/* If we can't read the status assume it's on. */
5846+
/* If we can't read the status assume it's always on. */
58475847
if (ops->is_enabled)
58485848
enabled = ops->is_enabled(rdev);
58495849
else
58505850
enabled = 1;
58515851

5852-
if (!enabled)
5852+
/* But if reading the status failed, assume that it's off. */
5853+
if (enabled <= 0)
58535854
goto unlock;
58545855

58555856
if (have_full_constraints()) {

0 commit comments

Comments
 (0)