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>
Thu, 23 Jan 2020 07:19:36 +0000 (08:19 +0100)
commita18a51a383a3e331bd72e8ce1b62a0fda4889f88
treeb009e75586add51445d096196c20233109cbc5db
parent04d8497656e443eccf22a7510e65f8df6140447e
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