mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-02 23:06:50 +07:00
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>
This commit is contained in:
parent
c1fc148024
commit
aebe495895
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user