Skip to content

Commit

Permalink
regulator: Don't report zero volts for the fixed voltage regulator
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mark Brown committed Nov 23, 2011
1 parent c1fc148 commit aebe495
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/regulator/fixed.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit aebe495

Please sign in to comment.