mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
regulator: core: resolve supply for boot-on/always-on regulators
commit98e48cd928
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:aea6cb9970
("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>
This commit is contained in:
parent
70cd19cb5b
commit
dd01a63547
1 changed files with 6 additions and 0 deletions
|
@ -1081,6 +1081,12 @@ static int set_machine_constraints(struct regulator_dev *rdev)
|
|||
* and we have control then make sure it is enabled.
|
||||
*/
|
||||
if (rdev->constraints->always_on || rdev->constraints->boot_on) {
|
||||
/* If we want to enable this regulator, make sure that we know
|
||||
* the supplying regulator.
|
||||
*/
|
||||
if (rdev->supply_name && !rdev->supply)
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
ret = _regulator_do_enable(rdev);
|
||||
if (ret < 0 && ret != -EINVAL) {
|
||||
rdev_err(rdev, "failed to enable\n");
|
||||
|
|
Loading…
Reference in a new issue