aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/imx6/patches-3.10/0028-regulator-pfuze100-Fix-off-by-one-for-max_register-s.patch
blob: 34ff796e8301c4f47d6fd4bc2b487ac0f51c4659 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From: Axel Lin <axel.lin@ingics.com>
Subject: [PATCH] regulator: pfuze100: Fix off-by-one for max_register setting

max_register should be register count - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Robin Gong <b38343@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/regulator/pfuze100-regulator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/regulator/pfuze100-regulator.c
+++ b/drivers/regulator/pfuze100-regulator.c
@@ -332,7 +332,7 @@ static int pfuze_identify(struct pfuze_c
 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,
 };