Skip to content

Commit 50bec7f

Browse files
AxelLinbroonie
authored andcommitted
regulator: hi6421v600: Fix .vsel_mask setting
Take ldo3_voltages as example, the ARRAY_SIZE(ldo3_voltages) is 16. i.e. the valid selector is 0 ~ 0xF. But in current code the vsel_mask is "(1 << 15) - 1", i.e. 0x7FFF. Fix it. Signed-off-by: Axel Lin <axel.lin@ingics.com> Link: https://lore.kernel.org/r/20210529013236.373847-1-axel.lin@ingics.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent bc537e6 commit 50bec7f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/staging/hikey9xx/hi6421v600-regulator.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ static const unsigned int ldo34_voltages[] = {
8383
.owner = THIS_MODULE, \
8484
.volt_table = vtable, \
8585
.n_voltages = ARRAY_SIZE(vtable), \
86-
.vsel_mask = (1 << (ARRAY_SIZE(vtable) - 1)) - 1, \
86+
.vsel_mask = ARRAY_SIZE(vtable) - 1, \
8787
.vsel_reg = vreg, \
8888
.enable_reg = ereg, \
8989
.enable_mask = emask, \

0 commit comments

Comments
 (0)