tty: serial: imx: use the sg count from dma_map_sg
authorPeng Fan <peng.fan@nxp.com>
Thu, 7 Nov 2019 06:42:53 +0000 (06:42 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Jan 2020 18:47:09 +0000 (19:47 +0100)
commit8dc7267338d4f761dfaa5b450f1d43d6f03e1494
tree9244457ecb9eb9a56002206f7ed3c85044373ddd
parentcd85fa3367143fa4c5cc2067dea7a64850ac9e11
tty: serial: imx: use the sg count from dma_map_sg

commit 596fd8dffb745afcebc0ec6968e17fe29f02044c upstream.

The dmaengine_prep_slave_sg needs to use sg count returned
by dma_map_sg, not use sport->dma_tx_nents, because the return
value of dma_map_sg is not always same with "nents".

Fixes: b4cdc8f61beb ("serial: imx: add DMA support for imx6q")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/1573108875-26530-1-git-send-email-peng.fan@nxp.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/imx.c