Skip to contentSkip to conversation

regulator: Don't report zero volts for the fixed voltage regulator

PATCH New Mark Brown 1 participant 1 message Nov 2, 2011 Voltage and current regulator framework

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/regulator/fixed.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/regulator/fixed.c +4 -1
index 21ecf21..ccbead0 100644
@@ -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,
Signature · 1 line
1.7.7.1