Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7d222dce authored by Michał Mirosław's avatar Michał Mirosław Committed by Greg Kroah-Hartman
Browse files

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: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Reported-by: default avatarOndřej Jirman <megous@megous.com>
Reported-by: default avatarCorentin Labbe <clabbe.montjoie@gmail.com>
Tested-by: default avatarOndřej Jirman <megous@megous.com>
Link: https://lore.kernel.org/r/a9041d68b4d35e4a2dd71629c8a6422662acb5ee.1604351936.git.mirq-linux@rere.qmqm.pl


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 31acccdc
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;
	}