diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-02 12:38:45 +0100 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-23 15:03:41 +0100 |
commit | aebe495895f5542213dd17a644647b0aae8353f0 (patch) | |
tree | bfce7987ec8565284ecf8ce73969607f9b454d78 /drivers/regulator/fixed.c | |
parent | regulator: TPS65910: Create an array for init data (diff) | |
download | linux-aebe495895f5542213dd17a644647b0aae8353f0.tar.xz linux-aebe495895f5542213dd17a644647b0aae8353f0.zip |
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.c | 5 |
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) { struct fixed_voltage_data *data = rdev_get_drvdata(dev); - return data->microvolts; + if (data->microvolts) + return data->microvolts; + else + return -EINVAL; } static int fixed_voltage_list_voltage(struct regulator_dev *dev, |