Commit 1bf5a1f8 authored by Mark Brown's avatar Mark Brown Committed by Liam Girdwood

regulator: Use _regulator_get_voltage() consistently

Rather than referencing the get_voltage() operation directly in the
ops struct use the internal _regulator_get_voltage() API call to do
so, facilitating refactoring.
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: default avatarLiam Girdwood <lrg@slimlogic.co.uk>
parent 43e7ee33
...@@ -581,14 +581,15 @@ static void drms_uA_update(struct regulator_dev *rdev) ...@@ -581,14 +581,15 @@ static void drms_uA_update(struct regulator_dev *rdev)
return; return;
/* get output voltage */ /* get output voltage */
output_uV = rdev->desc->ops->get_voltage(rdev); output_uV = _regulator_get_voltage(rdev);
if (output_uV <= 0) if (output_uV <= 0)
return; return;
/* get input voltage */ /* get input voltage */
if (rdev->supply && rdev->supply->desc->ops->get_voltage) input_uV = 0;
input_uV = rdev->supply->desc->ops->get_voltage(rdev->supply); if (rdev->supply)
else input_uV = _regulator_get_voltage(rdev);
if (input_uV <= 0)
input_uV = rdev->constraints->input_uV; input_uV = rdev->constraints->input_uV;
if (input_uV <= 0) if (input_uV <= 0)
return; return;
...@@ -1908,16 +1909,17 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load) ...@@ -1908,16 +1909,17 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
goto out; goto out;
/* get output voltage */ /* get output voltage */
output_uV = rdev->desc->ops->get_voltage(rdev); output_uV = _regulator_get_voltage(rdev);
if (output_uV <= 0) { if (output_uV <= 0) {
rdev_err(rdev, "invalid output voltage found\n"); rdev_err(rdev, "invalid output voltage found\n");
goto out; goto out;
} }
/* get input voltage */ /* get input voltage */
if (rdev->supply && rdev->supply->desc->ops->get_voltage) input_uV = 0;
input_uV = rdev->supply->desc->ops->get_voltage(rdev->supply); if (rdev->supply)
else input_uV = _regulator_get_voltage(rdev->supply);
if (input_uV <= 0)
input_uV = rdev->constraints->input_uV; input_uV = rdev->constraints->input_uV;
if (input_uV <= 0) { if (input_uV <= 0) {
rdev_err(rdev, "invalid input voltage found\n"); rdev_err(rdev, "invalid input voltage found\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment