diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-12-10 17:28:06 +0000 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2011-01-12 14:33:01 +0000 |
commit | 1bf5a1f86a328122714680cd59951074b4f31e07 (patch) | |
tree | 5b3f73623ecd383d4cbb7e937b8f7f42c0310971 /drivers/regulator | |
parent | 43e7ee33f2a8d20238267b789791386739247478 (diff) | |
download | linux-1bf5a1f86a328122714680cd59951074b4f31e07.tar.gz linux-1bf5a1f86a328122714680cd59951074b4f31e07.tar.bz2 linux-1bf5a1f86a328122714680cd59951074b4f31e07.zip |
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: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'drivers/regulator')
-rw-r--r-- | drivers/regulator/core.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 5d07e5dd417f..671eb53b5cdc 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c @@ -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"); |