MLK-17108-4 usb: typec: tcpci: correct read data msg length
authorLi Jun <jun.li@nxp.com>
Wed, 9 Jan 2019 09:59:41 +0000 (15:29 +0530)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
commitd2eb7c0b47e6f8a7db1e4d3a5a231c768b2296f4
treec757ddf2831645ccbe7da8adfb22559bf85c63f0
parentb1e912585c275247bf4f2ad89249c5d1736cc8f2
MLK-17108-4 usb: 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>
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
drivers/usb/typec/tcpci.c