Skip to content

Commit

Permalink
regmap: spmi: Fix regmap_spmi_ext_read in multi-byte case
Browse files Browse the repository at this point in the history
[ Upstream commit dec8e8f ]

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: c9afbb0 ("regmap: spmi: support base and extended register spaces")
Signed-off-by: Jack Pham <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
Jack Pham authored and sashalevin committed May 17, 2016
1 parent eab5159 commit 24a5073
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/base/regmap/regmap-spmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 24a5073

Please sign in to comment.