summaryrefslogtreecommitdiff
path: root/drivers/tty/serial/fsl_lpuart.c
diff options
context:
space:
mode:
authorFugang Duan <fugang.duan@nxp.com>2017-06-06 14:11:24 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:26:45 +0800
commit2b0e806f689b9677c12e3aa4f7f660caccfd0548 (patch)
tree302238ad8d703c0529fbafe96c65faa24e8ed8f2 /drivers/tty/serial/fsl_lpuart.c
parent9040d9cbad47e9c69da0dbee66bd6b83fa04d51b (diff)
MLK-15031-02 tty: serial: fsl_lpuart: free the rx dma buffer when port is closed
Free the rx dma buffer when the port is closed. Signed-off-by: Fugang Duan <fugang.duan@nxp.com> Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Diffstat (limited to 'drivers/tty/serial/fsl_lpuart.c')
-rw-r--r--drivers/tty/serial/fsl_lpuart.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index 0cebee635ca1..62acf4364a02 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -1054,6 +1054,7 @@ static void lpuart_dma_rx_free(struct uart_port *port)
dma_unmap_single(sport->port.dev, sport->dma_rx_buf_bus,
sport->rxdma_len, DMA_FROM_DEVICE);
+ devm_kfree(sport->port.dev, sport->dma_rx_buf_virt);
sport->dma_rx_buf_bus = 0;
sport->dma_rx_buf_virt = NULL;
}
@@ -1492,8 +1493,8 @@ static void lpuart_shutdown(struct uart_port *port)
sport->dma_rx_in_progress = false;
dmaengine_terminate_all(sport->dma_rx_chan);
}
- lpuart_dma_rx_free(&sport->port);
del_timer_sync(&sport->lpuart_timer);
+ lpuart_dma_rx_free(&sport->port);
}
if (sport->lpuart_dma_tx_use) {
@@ -1539,8 +1540,8 @@ static void lpuart32_shutdown(struct uart_port *port)
sport->dma_rx_in_progress = false;
dmaengine_terminate_all(sport->dma_rx_chan);
}
- lpuart_dma_rx_free(&sport->port);
del_timer_sync(&sport->lpuart_timer);
+ lpuart_dma_rx_free(&sport->port);
}
if (sport->lpuart_dma_tx_use) {