summaryrefslogtreecommitdiff
path: root/drivers/regulator/fixed.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator/fixed.c')
-rw-r--r--drivers/regulator/fixed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/regulator/fixed.c b/drivers/regulator/fixed.c
index ebec5e06dfa1..72abbf5507a6 100644
--- a/drivers/regulator/fixed.c
+++ b/drivers/regulator/fixed.c
@@ -135,7 +135,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,