Skip to content

Commit 06653eb

Browse files
Dmitry Baryshkovgregkh
authored andcommitted
regulator: core: resolve supply for boot-on/always-on regulators
commit 98e48cd upstream. For the boot-on/always-on regulators the set_machine_constrainst() is called before resolving rdev->supply. Thus the code would try to enable rdev before enabling supplying regulator. Enforce resolving supply regulator before enabling rdev. Fixes: aea6cb9 ("regulator: resolve supply after creating regulator") Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Link: https://lore.kernel.org/r/20210519221224.2868496-1-dmitry.baryshkov@linaro.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 7dcdfa2 commit 06653eb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎drivers/regulator/core.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,12 @@ static int set_machine_constraints(struct regulator_dev *rdev)
14221422
* and we have control then make sure it is enabled.
14231423
*/
14241424
if (rdev->constraints->always_on || rdev->constraints->boot_on) {
1425+
/* If we want to enable this regulator, make sure that we know
1426+
* the supplying regulator.
1427+
*/
1428+
if (rdev->supply_name && !rdev->supply)
1429+
return -EPROBE_DEFER;
1430+
14251431
if (rdev->supply) {
14261432
ret = regulator_enable(rdev->supply);
14271433
if (ret < 0) {

0 commit comments

Comments
 (0)