aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/fixed.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-02 07:38:45 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-11-23 09:03:41 -0500
commitaebe495895f5542213dd17a644647b0aae8353f0 (patch)
treebfce7987ec8565284ecf8ce73969607f9b454d78 /drivers/regulator/fixed.c
parentc1fc1480249dfe059254779a4bb7ca27cf5f8038 (diff)
regulator: Don't report zero volts for the fixed voltage regulator
If we don't know what voltage the regulator is set to return an error rather than reporting zero volts. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r--drivers/regulator/fixed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index 21ecf212a522..ccbead06c8f3 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -80,7 +80,10 @@ static int fixed_voltage_get_voltage(struct regulator_dev *dev)
80{ 80{
81 struct fixed_voltage_data *data = rdev_get_drvdata(dev); 81 struct fixed_voltage_data *data = rdev_get_drvdata(dev);
82 82
83 return data->microvolts; 83 if (data->microvolts)
84 return data->microvolts;
85 else
86 return -EINVAL;
84} 87}
85 88
86static int fixed_voltage_list_voltage(struct regulator_dev *dev, 89static int fixed_voltage_list_voltage(struct regulator_dev *dev,