From: Axel Lin Date: Thu, 1 Aug 2013 11:59:56 +0000 (+0800) Subject: regulator: pfuze100: Fix off-by-one for max_register setting X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6b8430c3f3090b8b805eb1fbe58390229d2dd067;p=linux-beck.git regulator: pfuze100: Fix off-by-one for max_register setting max_register should be register count - 1. Signed-off-by: Axel Lin Reviewed-by: Robin Gong Signed-off-by: Mark Brown --- diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c index bda55617092b..ba67b2c4e2e7 100644 --- a/drivers/regulator/pfuze100-regulator.c +++ b/drivers/regulator/pfuze100-regulator.c @@ -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, };