2023-02-11 15:00:41

by Axel Lin

[permalink] [raw]
Subject: [PATCH] regulator: max20411: Fix off-by-one for n_voltages setting

Otherwise regulator_list_voltage returns -EINVAL for MAX20411_MAX_SEL.

Signed-off-by: Axel Lin <[email protected]>
---
drivers/regulator/max20411-regulator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/regulator/max20411-regulator.c b/drivers/regulator/max20411-regulator.c
index e75d16048e2f..83dacb4ff173 100644
--- a/drivers/regulator/max20411-regulator.c
+++ b/drivers/regulator/max20411-regulator.c
@@ -85,7 +85,7 @@ static const struct regulator_desc max20411_desc = {
.min_uV = MAX20411_BASE_UV,
.uV_step = MAX20411_UV_STEP,
.linear_min_sel = MAX20411_MIN_SEL,
- .n_voltages = MAX20411_MAX_SEL,
+ .n_voltages = MAX20411_MAX_SEL + 1,

.vsel_reg = MAX20411_VID_OFFSET,
.vsel_mask = MAX20411_VID_MASK,
--
2.34.1



2023-02-13 14:21:10

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] regulator: max20411: Fix off-by-one for n_voltages setting

On Sat, 11 Feb 2023 23:00:19 +0800, Axel Lin wrote:
> Otherwise regulator_list_voltage returns -EINVAL for MAX20411_MAX_SEL.
>
>

Applied to

broonie/regulator.git for-next

Thanks!

[1/1] regulator: max20411: Fix off-by-one for n_voltages setting
commit: 9d1c73191f94c79076b5f46a31b8a1e12b18bc79

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark