Skip to content

Commit

Permalink
regulator: defer probe when trying to get voltage from unresolved supply
Browse files Browse the repository at this point in the history
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: aea6cb9 ("regulator: resolve supply after creating regulator")
Cc: [email protected]
Signed-off-by: Michał Mirosław <[email protected]>
Reported-by: Ondřej Jirman <[email protected]>
Reported-by: Corentin Labbe <[email protected]>
Tested-by: Ondřej Jirman <[email protected]>
Link: https://lore.kernel.org/r/a9041d68b4d35e4a2dd71629c8a6422662acb5ee.1604351936.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
osctobe authored and broonie committed Nov 3, 2020
1 parent f59cddd commit cf1ad55
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cf1ad55

Please sign in to comment.