mirror of https://gitee.com/openkylin/linux.git
regulator: fixed: fix regulator_list_voltage() for regression
Commitc368e5fc2a
"regulator: fixed: get rid of {get|list}_voltage()" broke regulator_list_voltage() for the fixed regulator, because an earlier commit5a523605af
"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>
This commit is contained in:
parent
d4d5cef649
commit
f446043f1a
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue