MLK-14498-6 tty: serial: imx: pass ->dev to dma_alloc_coherent() API
authorAndy Duan <fugang.duan@nxp.com>
Mon, 20 Mar 2017 08:04:15 +0000 (16:04 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:39 +0000 (15:21 -0500)
Pass ->dev to dma_alloc_coherent() API to avoid kernel dump.

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
drivers/tty/serial/imx.c

index 22bd5a4..fa06bc9 100644 (file)
@@ -1104,7 +1104,7 @@ static void imx_uart_dma_exit(struct imx_port *sport)
                sport->dma_chan_rx = NULL;
 
                if (sport->rx_buf.buf) {
-                       dma_free_coherent(NULL, IMX_RXBD_NUM * RX_BUF_SIZE,
+                       dma_free_coherent(sport->port.dev, IMX_RXBD_NUM * RX_BUF_SIZE,
                                                (void *)sport->rx_buf.buf,
                                                sport->rx_buf.dmaaddr);
                        sport->rx_buf.buf = NULL;
@@ -1143,7 +1143,7 @@ static int imx_uart_dma_init(struct imx_port *sport)
                goto err;
        }
 
-       sport->rx_buf.buf = dma_alloc_coherent(NULL, IMX_RXBD_NUM * RX_BUF_SIZE,
+       sport->rx_buf.buf = dma_alloc_coherent(sport->port.dev, IMX_RXBD_NUM * RX_BUF_SIZE,
                                        &sport->rx_buf.dmaaddr, GFP_KERNEL);
        if (!sport->rx_buf.buf) {
                dev_err(dev, "cannot alloc DMA buffer.\n");