提交 aebe4958 编写于 作者: M Mark Brown

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: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 c1fc1480
...@@ -80,7 +80,10 @@ static int fixed_voltage_get_voltage(struct regulator_dev *dev) ...@@ -80,7 +80,10 @@ static int fixed_voltage_get_voltage(struct regulator_dev *dev)
{ {
struct fixed_voltage_data *data = rdev_get_drvdata(dev); struct fixed_voltage_data *data = rdev_get_drvdata(dev);
if (data->microvolts)
return data->microvolts; return data->microvolts;
else
return -EINVAL;
} }
static int fixed_voltage_list_voltage(struct regulator_dev *dev, static int fixed_voltage_list_voltage(struct regulator_dev *dev,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册