diff options
-rw-r--r-- | drivers/regulator/core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 8521e0d6b3bc..5c6aedaa934d 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2070,6 +2070,14 @@ int regulator_map_voltage_linear(struct regulator_dev *rdev, | |||
2070 | { | 2070 | { |
2071 | int ret, voltage; | 2071 | int ret, voltage; |
2072 | 2072 | ||
2073 | /* Allow uV_step to be 0 for fixed voltage */ | ||
2074 | if (rdev->desc->n_voltages == 1 && rdev->desc->uV_step == 0) { | ||
2075 | if (min_uV <= rdev->desc->min_uV && rdev->desc->min_uV <= max_uV) | ||
2076 | return 0; | ||
2077 | else | ||
2078 | return -EINVAL; | ||
2079 | } | ||
2080 | |||
2073 | if (!rdev->desc->uV_step) { | 2081 | if (!rdev->desc->uV_step) { |
2074 | BUG_ON(!rdev->desc->uV_step); | 2082 | BUG_ON(!rdev->desc->uV_step); |
2075 | return -EINVAL; | 2083 | return -EINVAL; |