Commit 9d1c7319 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: max20411: Fix off-by-one for n_voltages setting

Otherwise regulator_list_voltage returns -EINVAL for MAX20411_MAX_SEL.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20230211150019.1545542-1-axel.lin@ingics.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6caacd82
...@@ -85,7 +85,7 @@ static const struct regulator_desc max20411_desc = { ...@@ -85,7 +85,7 @@ static const struct regulator_desc max20411_desc = {
.min_uV = MAX20411_BASE_UV, .min_uV = MAX20411_BASE_UV,
.uV_step = MAX20411_UV_STEP, .uV_step = MAX20411_UV_STEP,
.linear_min_sel = MAX20411_MIN_SEL, .linear_min_sel = MAX20411_MIN_SEL,
.n_voltages = MAX20411_MAX_SEL, .n_voltages = MAX20411_MAX_SEL + 1,
.vsel_reg = MAX20411_VID_OFFSET, .vsel_reg = MAX20411_VID_OFFSET,
.vsel_mask = MAX20411_VID_MASK, .vsel_mask = MAX20411_VID_MASK,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment