linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] regulator: pfuze100: Fix off-by-one for max_register setting
@ 2013-08-01 11:59 Axel Lin
  2013-08-02  2:06 ` Robin Gong
  2013-08-02 10:29 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Axel Lin @ 2013-08-01 11:59 UTC (permalink / raw)
  To: Mark Brown; +Cc: Robin Gong, Liam Girdwood, linux-kernel

max_register should be register count - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
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(-)

diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
index bda5561..ba67b2c 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,
 };
 
-- 
1.8.1.2




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-02 10:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-01 11:59 [PATCH] regulator: pfuze100: Fix off-by-one for max_register setting Axel Lin
2013-08-02  2:06 ` Robin Gong
2013-08-02 10:29 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).