aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-10 12:28:06 -0500
committerLiam Girdwood <lrg@slimlogic.co.uk>2011-01-12 09:33:01 -0500
commit1bf5a1f86a328122714680cd59951074b4f31e07 (patch)
tree5b3f73623ecd383d4cbb7e937b8f7f42c0310971 /drivers
parent43e7ee33f2a8d20238267b789791386739247478 (diff)
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')
-rw-r--r--drivers/regulator/core.c18
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)
581 return; 581 return;
582 582
583 /* get output voltage */ 583 /* get output voltage */
584 output_uV = rdev->desc->ops->get_voltage(rdev); 584 output_uV = _regulator_get_voltage(rdev);
585 if (output_uV <= 0) 585 if (output_uV <= 0)
586 return; 586 return;
587 587
588 /* get input voltage */ 588 /* get input voltage */
589 if (rdev->supply && rdev->supply->desc->ops->get_voltage) 589 input_uV = 0;
590 input_uV = rdev->supply->desc->ops->get_voltage(rdev->supply); 590 if (rdev->supply)
591 else 591 input_uV = _regulator_get_voltage(rdev);
592 if (input_uV <= 0)
592 input_uV = rdev->constraints->input_uV; 593 input_uV = rdev->constraints->input_uV;
593 if (input_uV <= 0) 594 if (input_uV <= 0)
594 return; 595 return;
@@ -1908,16 +1909,17 @@ int regulator_set_optimum_mode(struct regulator *regulator, int uA_load)
1908 goto out; 1909 goto out;
1909 1910
1910 /* get output voltage */ 1911 /* get output voltage */
1911 output_uV = rdev->desc->ops->get_voltage(rdev); 1912 output_uV = _regulator_get_voltage(rdev);
1912 if (output_uV <= 0) { 1913 if (output_uV <= 0) {
1913 rdev_err(rdev, "invalid output voltage found\n"); 1914 rdev_err(rdev, "invalid output voltage found\n");
1914 goto out; 1915 goto out;
1915 } 1916 }
1916 1917
1917 /* get input voltage */ 1918 /* get input voltage */
1918 if (rdev->supply && rdev->supply->desc->ops->get_voltage) 1919 input_uV = 0;
1919 input_uV = rdev->supply->desc->ops->get_voltage(rdev->supply); 1920 if (rdev->supply)
1920 else 1921 input_uV = _regulator_get_voltage(rdev->supply);
1922 if (input_uV <= 0)
1921 input_uV = rdev->constraints->input_uV; 1923 input_uV = rdev->constraints->input_uV;
1922 if (input_uV <= 0) { 1924 if (input_uV <= 0) {
1923 rdev_err(rdev, "invalid input voltage found\n"); 1925 rdev_err(rdev, "invalid input voltage found\n");