regulator: pfuze100: Fix off-by-one for max_register setting
PATCH 1/1 regulator: pfuze100: Fix off-by-one for max_register setting
max_register should be register count - 1.
Signed-off-by Axel Lin <[email protected]>
---
Hi Robin,
I don't have the datasheet, can you check if this patch is correct or not? If PFUZE_NUMREGS really means register count, I think this fix is required.
Thanks,
Axel
drivers/regulator/pfuze100-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/regulator/pfuze100-regulator.c +1 -1
@@ -332,7 +332,7 @@ static int pfuze_identify(struct pfuze_chip *pfuze_chip)static const struct regmap_config pfuze_regmap_config = { .reg_bits =8 , .val_bits =8 , - .max_register =PFUZE_NUMREGS , + .max_register =PFUZE_NUMREGS -1 , .cache_type =REGCACHE_RBTREE , };
Signature · 1 line
1.8.1.2
Quoted 8 lines · Axel Lin
max_registershould be register count - 1.Signed-off-by Axel Lin <[email protected]>---
Hi Robin,
I don't have the datasheet, can you check if this patch is correct or not? IfPFUZE_NUMREGSreally means register count, I think this fix is required.
Yes, you are right.
Reviewed-by Robin Gong <[email protected]>
Thanks.
Quoted 24 lines
Thanks,
Axeldrivers/regulator/pfuze100-regulator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/regulator/pfuze100-regulator.c +1
-1@@ -332,7 +332,7 @@ static int pfuze_identify(struct pfuze_chip *pfuze_chip)static const struct regmap_config pfuze_regmap_config = { .reg_bits =8 , .val_bits =8 , - .max_register =PFUZE_NUMREGS , + .max_register =PFUZE_NUMREGS -1 , .cache_type =REGCACHE_RBTREE , };Signature · 1 line
1.8.1.2
Quoted 1 line · Axel Lin
max_registershould be register count - 1.
Applied, thanks.