summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/core.c
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2020-11-02 22:27:27 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-11-18 19:18:40 +0100
commit7d222dce964ddb0be42ae4f2f45beb1beaee19bd (patch)
tree957c52c09204fbd00e079a934926fa6435501ecd /drivers/regulator/core.c
parent31acccdc877486a649a86d37725a15175fcd5ed6 (diff)
downloadlinux-stable-7d222dce964ddb0be42ae4f2f45beb1beaee19bd.tar.gz
linux-stable-7d222dce964ddb0be42ae4f2f45beb1beaee19bd.tar.bz2
linux-stable-7d222dce964ddb0be42ae4f2f45beb1beaee19bd.zip
regulator: defer probe when trying to get voltage from unresolved supply
[ Upstream commit cf1ad559a20d1930aa7b47a52f54e1f8718de301 ] regulator_get_voltage_rdev() is called in regulator probe() when applying machine constraints. The "fixed" commit exposed the problem that non-bypassed regulators can forward the request to its parent (like bypassed ones) supply. Return -EPROBE_DEFER when the supply is expected but not resolved yet. Fixes: aea6cb99703e ("regulator: resolve supply after creating regulator") Cc: stable@vger.kernel.org Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Reported-by: Ondřej Jirman <megous@megous.com> Reported-by: Corentin Labbe <clabbe.montjoie@gmail.com> Tested-by: Ondřej Jirman <megous@megous.com> Link: https://lore.kernel.org/r/a9041d68b4d35e4a2dd71629c8a6422662acb5ee.1604351936.git.mirq-linux@rere.qmqm.pl Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r--drivers/regulator/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index c290c8942131..ad5235ca8e4e 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -3405,6 +3405,8 @@ static int _regulator_get_voltage(struct regulator_dev *rdev)
ret = rdev->desc->fixed_uV;
} else if (rdev->supply) {
ret = _regulator_get_voltage(rdev->supply->rdev);
+ } else if (rdev->supply_name) {
+ return -EPROBE_DEFER;
} else {
return -EINVAL;
}