Skip to content

Commit

Permalink
regulator: fixed: fix regulator_list_voltage() for regression
Browse files Browse the repository at this point in the history
Commit c368e5f "regulator: fixed:
get rid of {get|list}_voltage()" broke regulator_list_voltage() for
the fixed regulator, because an earlier commit
5a52360 "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>
  • Loading branch information
Guennadi Liakhovetski authored and Mark Brown committed Nov 13, 2013
1 parent d4d5cef commit f446043
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/regulator/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2184,6 +2184,9 @@ int regulator_list_voltage(struct regulator *regulator, unsigned selector)
struct regulator_ops *ops = rdev->desc->ops;
int ret;

if (rdev->desc->fixed_uV && rdev->desc->n_voltages == 1 && !selector)
return rdev->desc->fixed_uV;

if (!ops->list_voltage || selector >= rdev->desc->n_voltages)
return -EINVAL;

Expand Down

0 comments on commit f446043

Please sign in to comment.