]> git.itanic.dy.fi Git - linux-stable/commitdiff
serial: atmel: convert not to use dma_request_slave_channel()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 19 Nov 2023 15:55:15 +0000 (16:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Nov 2023 19:32:36 +0000 (19:32 +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/f2e9790d8b49aeba8b43ce018d30a35b837ac1eb.1700409299.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/atmel_serial.c

index 6792680690bd1e660e42e5c2fe6895867ec091b3..85667f7095154eff29a7ba402f99894518d78c60 100644 (file)
@@ -1013,14 +1013,18 @@ static int atmel_prepare_tx_dma(struct uart_port *port)
        struct device *mfd_dev = port->dev->parent;
        dma_cap_mask_t          mask;
        struct dma_slave_config config;
+       struct dma_chan *chan;
        int ret, nent;
 
        dma_cap_zero(mask);
        dma_cap_set(DMA_SLAVE, mask);
 
-       atmel_port->chan_tx = dma_request_slave_channel(mfd_dev, "tx");
-       if (atmel_port->chan_tx == NULL)
+       chan = dma_request_chan(mfd_dev, "tx");
+       if (IS_ERR(chan)) {
+               atmel_port->chan_tx = NULL;
                goto chan_err;
+       }
+       atmel_port->chan_tx = chan;
        dev_info(port->dev, "using %s for tx DMA transfers\n",
                dma_chan_name(atmel_port->chan_tx));
 
@@ -1188,6 +1192,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
        dma_cap_mask_t          mask;
        struct dma_slave_config config;
        struct circ_buf         *ring;
+       struct dma_chan *chan;
        int ret, nent;
 
        ring = &atmel_port->rx_ring;
@@ -1195,9 +1200,12 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
        dma_cap_zero(mask);
        dma_cap_set(DMA_CYCLIC, mask);
 
-       atmel_port->chan_rx = dma_request_slave_channel(mfd_dev, "rx");
-       if (atmel_port->chan_rx == NULL)
+       chan = dma_request_chan(mfd_dev, "rx");
+       if (IS_ERR(chan)) {
+               atmel_port->chan_rx = NULL;
                goto chan_err;
+       }
+       atmel_port->chan_rx = chan;
        dev_info(port->dev, "using %s for rx DMA transfers\n",
                dma_chan_name(atmel_port->chan_rx));