Skip to content
Unverified Commit 57c045bc authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: hi6421v600: Fix setting idle mode



commit db27f829 changed eco_mode << (ffs(sreg->eco_mode_mask) - 1)
to sreg->eco_mode_mask << (ffs(sreg->eco_mode_mask) - 1) which is wrong.
Fix it by simply set val = sreg->eco_mode_mask.

In additional, sreg->eco_mode_mask can be 0 (LDO3, LDO33, LDO34).
Return -EINVAL if idle mode is not supported when sreg->eco_mode_mask is 0.

While at it, also use unsigned int for reg_val/val which is the expected
type for regmap_read and regmap_update_bits.

Fixes: db27f829 ("staging: regulator: hi6421v600-regulator: use shorter names for OF properties")
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Link: https://lore.kernel.org/r/20210619123423.4091429-1-axel.lin@ingics.com


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 01c5741b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment