regulator: scmi: Fix off-by-one for linear regulators .n_voltages setting
authorAxel Lin <axel.lin@ingics.com>
Fri, 21 May 2021 07:30:20 +0000 (15:30 +0800)
committerMark Brown <broonie@kernel.org>
Fri, 21 May 2021 19:05:48 +0000 (20:05 +0100)
commit36cb555fae0875d5416e8514a84a427bec6e4cda
treec55ff4b3cd3e839f21f0d0dab5a217ea53e196a6
parent98e48cd9283dbac0e1445ee780889f10b3d1db6a
regulator: scmi: Fix off-by-one for linear regulators .n_voltages setting

For linear regulators, the .n_voltages is (max_uv - min_uv) / uv_step + 1.

Fixes: 0fbeae70ee7c ("regulator: add SCMI driver")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Link: https://lore.kernel.org/r/20210521073020.1944981-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/regulator/scmi-regulator.c