summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
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
parent51c0a0c63fd0cf1953086cd6ec7d6f068418441a (diff)
parentc088a4985e5f6f6c2cbe5a6953357dfc30b7c57e (diff)
downloadlinux-811c732f468833fea8619fe06c2bb71368d6984a.tar.bz2
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')
-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()) {