|
@@ -581,14 +581,15 @@ static void drms_uA_update(struct regulator_dev *rdev)
|
|
|
return;
|
|
|
|
|
|
/* get output voltage */
|
|
|
- output_uV = rdev->desc->ops->get_voltage(rdev);
|
|
|
+ output_uV = _regulator_get_voltage(rdev);
|
|
|
if (output_uV <= 0)
|
|
|
return;
|
|
|
|
|
|
/* get input voltage */
|
|
|
- if (rdev->supply && rdev->supply->desc->ops->get_voltage)
|
|
|
- input_uV = rdev->supply->desc->ops->get_voltage(rdev->supply);
|
|
|
- else
|
|
|
+ input_uV = 0;
|
|
|
+ if (rdev->supply)
|
|
|
+ input_uV = _regulator_get_voltage(rdev);
|
|
|
+ if (input_uV <= 0)
|
|
|
input_uV = rdev->constraints->input_uV;
|
|
|
if (input_uV <= 0)
|
|
|
return;
|
|
@@ -1908,16 +1909,17 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
|
|
|
goto out;
|
|
|
|
|
|
/* get output voltage */
|
|
|
- output_uV = rdev->desc->ops->get_voltage(rdev);
|
|
|
+ output_uV = _regulator_get_voltage(rdev);
|
|
|
if (output_uV <= 0) {
|
|
|
rdev_err(rdev, "invalid output voltage found\n");
|
|
|
goto out;
|
|
|
}
|
|
|
|
|
|
/* get input voltage */
|
|
|
- if (rdev->supply && rdev->supply->desc->ops->get_voltage)
|
|
|
- input_uV = rdev->supply->desc->ops->get_voltage(rdev->supply);
|
|
|
- else
|
|
|
+ input_uV = 0;
|
|
|
+ if (rdev->supply)
|
|
|
+ input_uV = _regulator_get_voltage(rdev->supply);
|
|
|
+ if (input_uV <= 0)
|
|
|
input_uV = rdev->constraints->input_uV;
|
|
|
if (input_uV <= 0) {
|
|
|
rdev_err(rdev, "invalid input voltage found\n");
|