]> git.itanic.dy.fi Git - linux-stable/commitdiff
serial: mxs-auart: convert not to use dma_request_slave_channel()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 19 Nov 2023 16:22:20 +0000 (17:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Nov 2023 19:33:01 +0000 (19:33 +0000)
dma_request_slave_channel() is deprecated. dma_request_chan() should
be used directly instead.

Switch to the preferred function and update the error handling accordingly.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/94812f7063e4db5590254ec45fe9bb3c6569509e.1700410918.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mxs-auart.c

index 2be9546e0e153e7f5a8efa1138ab55123ab8c486..3ec725555bcc1e6eb2843a186a5c49cba1ab0b42 100644 (file)
@@ -904,21 +904,27 @@ static void mxs_auart_dma_exit(struct mxs_auart_port *s)
 
 static int mxs_auart_dma_init(struct mxs_auart_port *s)
 {
+       struct dma_chan *chan;
+
        if (auart_dma_enabled(s))
                return 0;
 
        /* init for RX */
-       s->rx_dma_chan = dma_request_slave_channel(s->dev, "rx");
-       if (!s->rx_dma_chan)
+       chan = dma_request_chan(s->dev, "rx");
+       if (IS_ERR(chan))
                goto err_out;
+       s->rx_dma_chan = chan;
+
        s->rx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
        if (!s->rx_dma_buf)
                goto err_out;
 
        /* init for TX */
-       s->tx_dma_chan = dma_request_slave_channel(s->dev, "tx");
-       if (!s->tx_dma_chan)
+       chan = dma_request_chan(s->dev, "tx");
+       if (IS_ERR(chan))
                goto err_out;
+       s->tx_dma_chan = chan;
+
        s->tx_dma_buf = kzalloc(UART_XMIT_SIZE, GFP_KERNEL | GFP_DMA);
        if (!s->tx_dma_buf)
                goto err_out;