summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIwona Winiarska <iwona.winiarska@intel.com>2022-03-31 22:17:20 +0300
committerIwona Winiarska <iwona.winiarska@intel.com>2022-04-19 22:42:46 +0300
commit4b3403cf5484c478319b5ba9f64e0e63e30698fa (patch)
tree0ba8134178d74e9b650b80943f7974e40e8cf0b0
parentad07a2e83f6c98f8c5a31e9210778c2060a150ef (diff)
downloadlinux-4b3403cf5484c478319b5ba9f64e0e63e30698fa.tar.xz
i3c: master: dw: Update read transfer length
Currently, the read transfer length is not updated with the actual number of read bytes, which means that the caller won't have this information and won't be able to distinguish real data obtained during transfer. For every successful read transfer, update its length. Signed-off-by: Iwona Winiarska <iwona.winiarska@intel.com>
-rw-r--r--drivers/i3c/master/dw-i3c-master.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/i3c/master/dw-i3c-master.c b/drivers/i3c/master/dw-i3c-master.c
index ce21b62e5be6..bda7c5e5972c 100644
--- a/drivers/i3c/master/dw-i3c-master.c
+++ b/drivers/i3c/master/dw-i3c-master.c
@@ -1494,6 +1494,13 @@ static int dw_i3c_master_priv_xfers(struct i3c_dev_desc *dev,
dw_i3c_master_dequeue_xfer(master, xfer);
ret = xfer->ret;
+ if (ret)
+ goto out;
+
+ for (i = 0; i < i3c_nxfers; i++)
+ if (i3c_xfers[i].rnw)
+ i3c_xfers[i].len = xfer->cmds[i].rx_len;
+out:
dw_i3c_master_free_xfer(xfer);
return ret;