summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Pham <jackp@codeaurora.org>2016-04-14 23:37:26 -0700
committerSasha Levin <sasha.levin@oracle.com>2016-05-17 14:31:25 -0400
commitb1da9479174d813374efd4103ba2233e5044dcd2 (patch)
tree0efee1c313b98293f28b3a0614147b28513cb5c3
parentf9133a946b21af76708e868eb299f1f26ec82e61 (diff)
downloadlinux-stable-b1da9479174d813374efd4103ba2233e5044dcd2.tar.gz
linux-stable-b1da9479174d813374efd4103ba2233e5044dcd2.tar.bz2
linux-stable-b1da9479174d813374efd4103ba2233e5044dcd2.zip
regmap: spmi: Fix regmap_spmi_ext_read in multi-byte case
[ Upstream commit dec8e8f6e6504aa3496c0f7cc10c756bb0e10f44 ] Specifically for the case of reads that use the Extended Register Read Long command, a multi-byte read operation is broken up into 8-byte chunks. However the call to spmi_ext_register_readl() is incorrectly passing 'val_size', which if greater than 8 will always fail. The argument should instead be 'len'. Fixes: c9afbb05a9ff ("regmap: spmi: support base and extended register spaces") Signed-off-by: Jack Pham <jackp@codeaurora.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
-rw-r--r--drivers/base/regmap/regmap-spmi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/base/regmap/regmap-spmi.c b/drivers/base/regmap/regmap-spmi.c
index d7026dc33388..b394aaef3867 100644
--- a/drivers/base/regmap/regmap-spmi.c
+++ b/drivers/base/regmap/regmap-spmi.c
@@ -153,7 +153,7 @@ static int regmap_spmi_ext_read(void *context,
while (val_size) {
len = min_t(size_t, val_size, 8);
- err = spmi_ext_register_readl(context, addr, val, val_size);
+ err = spmi_ext_register_readl(context, addr, val, len);
if (err)
goto err_out;