Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

regulator: mt6315: Fix off-by-one for .n_voltages

The valid selector is 0 ~ 0xbf, so the .n_voltages should be 0xc0.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210311020558.579597-1-axel.lin@ingics.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Axel Lin and committed by
Mark Brown
d450293c e9e7fce0

+1 -1
+1 -1
drivers/regulator/mt6315-regulator.c
··· 41 41 .type = REGULATOR_VOLTAGE, \ 42 42 .id = _bid, \ 43 43 .owner = THIS_MODULE, \ 44 - .n_voltages = 0xbf, \ 44 + .n_voltages = 0xc0, \ 45 45 .linear_ranges = mt_volt_range1, \ 46 46 .n_linear_ranges = ARRAY_SIZE(mt_volt_range1), \ 47 47 .vsel_reg = _vsel, \