regulator: core: Fix getting input_uV when supplied by another regulator
When supplied by another regulator, returns the supply regulator's output
voltage for inpu_uV.
Signed-off-by: Axel Lin <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index d4d34cb..713981b 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -649,7 +649,7 @@
/* get input voltage */
input_uV = 0;
if (rdev->supply)
- input_uV = _regulator_get_voltage(rdev);
+ input_uV = regulator_get_voltage(rdev->supply);
if (input_uV <= 0)
input_uV = rdev->constraints->input_uV;
if (input_uV <= 0)