diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2013-11-13 06:33:00 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-13 09:00:51 -0500 |
commit | f446043f1aa74c2d699db48ba4a7a075b88dc14d (patch) | |
tree | b922e32aa5cfeed3dd2a44dff018c8acbacfe362 /drivers/regulator/core.c | |
parent | d4d5cef649d1042454c286474343cec50ff1cb60 (diff) |
regulator: fixed: fix regulator_list_voltage() for regression
Commit c368e5fc2a190923b786f2de3e79430ea3566a25 "regulator: fixed:
get rid of {get|list}_voltage()" broke regulator_list_voltage() for
the fixed regulator, because an earlier commit
5a523605afa7d3b54b2e7041f8c9e6bc39872a7e "regulator: core: provide
fixed voltage in desc for single voltage rail" missed to add support
for the fixed-voltage special case to that function. This patch
fixes that regression.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator/core.c')
-rw-r--r-- | drivers/regulator/core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index 6382f0af353b..3fe13130baec 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -2184,6 +2184,9 @@ int regulator_list_voltage(struct regulator *regulator, unsigned selector) | |||
2184 | struct regulator_ops *ops = rdev->desc->ops; | 2184 | struct regulator_ops *ops = rdev->desc->ops; |
2185 | int ret; | 2185 | int ret; |
2186 | 2186 | ||
2187 | if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1 && !selector) | ||
2188 | return rdev->desc->fixed_uV; | ||
2189 | |||
2187 | if (!ops->list_voltage || selector >= rdev->desc->n_voltages) | 2190 | if (!ops->list_voltage || selector >= rdev->desc->n_voltages) |
2188 | return -EINVAL; | 2191 | return -EINVAL; |
2189 | 2192 | ||