aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-11-11 12:37:42 +0000
committerMark Brown <broonie@kernel.org>2020-11-11 12:37:42 +0000
commit811c732f468833fea8619fe06c2bb71368d6984a (patch)
tree76fb49d9e0701f72b63d892b3c7b1d46a98b9745 /drivers/regulator/core.c
parentMerge series "regulator: bd718x7: support voltage scaling" from Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>: (diff)
parentregulator: core: don't disable regulator if is_enabled return error. (diff)
downloadlinux-dev-811c732f468833fea8619fe06c2bb71368d6984a.tar.xz
linux-dev-811c732f468833fea8619fe06c2bb71368d6984a.zip
Merge branch 'for-5.10' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator into regulator-5.11
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 79d00e7039d9..2e1ea18221ef 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -4165,6 +4165,8 @@ int regulator_get_voltage_rdev(struct regulator_dev *rdev)
ret = rdev->desc->fixed_uV;
} else if (rdev->supply) {
ret = regulator_get_voltage_rdev(rdev->supply->rdev);
+ } else if (rdev->supply_name) {
+ return -EPROBE_DEFER;
} else {
return -EINVAL;
}
@@ -5841,13 +5843,14 @@ static int regulator_late_cleanup(struct device *dev, void *data)
if (rdev->use_count)
goto unlock;
- /* If we can't read the status assume it's on. */
+ /* If we can't read the status assume it's always on. */
if (ops->is_enabled)
enabled = ops->is_enabled(rdev);
else
enabled = 1;
- if (!enabled)
+ /* But if reading the status failed, assume that it's off. */
+ if (enabled <= 0)
goto unlock;
if (have_full_constraints()) {