Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f446043f authored by Guennadi Liakhovetski's avatar Guennadi Liakhovetski Committed by Mark Brown
Browse files

regulator: fixed: fix regulator_list_voltage() for regression



Commit c368e5fc "regulator: fixed:
get rid of {get|list}_voltage()" broke regulator_list_voltage() for
the fixed regulator, because an earlier commit
5a523605 "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: default avatarGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent d4d5cef6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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;