MLK-17108-4 staging: typec: tcpci: correct read data msg length
authorLi Jun <jun.li@nxp.com>
Thu, 25 Jan 2018 12:01:46 +0000 (20:01 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:53:57 +0000 (14:53 -0500)
commit84a477ccc3c38a76c0cd8e19cd8f8599900027d8
treedef78ce32b57f726cc751bda9f1f49b4ddc79e7d
parent3eaf1b2be3edfb0459f8d264c9ba196aceead24a
MLK-17108-4 staging: typec: tcpci: correct read data msg length

Per tcpci spec, the TCPC_RX_BYTE_CNT is the number of bytes in the
RX_BUFFER_DATA_OBJECTS plus three (for the RX_BUF_FRAME_TYPE and
RX_BUF_HEADER), so after read out the header, we should only read
TCPC_RX_BYTE_CNT-3 bytes for data if this is a data message.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
drivers/staging/typec/tcpci.c