Commit ec9fc2cf authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Greg Kroah-Hartman

serial: atmel: convert not to use dma_request_slave_channel()

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/f2e9790d8b49aeba8b43ce018d30a35b837ac1eb.1700409299.git.christophe.jaillet@wanadoo.frSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 3837a037
...@@ -1013,14 +1013,18 @@ static int atmel_prepare_tx_dma(struct uart_port *port) ...@@ -1013,14 +1013,18 @@ static int atmel_prepare_tx_dma(struct uart_port *port)
struct device *mfd_dev = port->dev->parent; struct device *mfd_dev = port->dev->parent;
dma_cap_mask_t mask; dma_cap_mask_t mask;
struct dma_slave_config config; struct dma_slave_config config;
struct dma_chan *chan;
int ret, nent; int ret, nent;
dma_cap_zero(mask); dma_cap_zero(mask);
dma_cap_set(DMA_SLAVE, mask); dma_cap_set(DMA_SLAVE, mask);
atmel_port->chan_tx = dma_request_slave_channel(mfd_dev, "tx"); chan = dma_request_chan(mfd_dev, "tx");
if (atmel_port->chan_tx == NULL) if (IS_ERR(chan)) {
atmel_port->chan_tx = NULL;
goto chan_err; goto chan_err;
}
atmel_port->chan_tx = chan;
dev_info(port->dev, "using %s for tx DMA transfers\n", dev_info(port->dev, "using %s for tx DMA transfers\n",
dma_chan_name(atmel_port->chan_tx)); dma_chan_name(atmel_port->chan_tx));
...@@ -1188,6 +1192,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port) ...@@ -1188,6 +1192,7 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
dma_cap_mask_t mask; dma_cap_mask_t mask;
struct dma_slave_config config; struct dma_slave_config config;
struct circ_buf *ring; struct circ_buf *ring;
struct dma_chan *chan;
int ret, nent; int ret, nent;
ring = &atmel_port->rx_ring; ring = &atmel_port->rx_ring;
...@@ -1195,9 +1200,12 @@ static int atmel_prepare_rx_dma(struct uart_port *port) ...@@ -1195,9 +1200,12 @@ static int atmel_prepare_rx_dma(struct uart_port *port)
dma_cap_zero(mask); dma_cap_zero(mask);
dma_cap_set(DMA_CYCLIC, mask); dma_cap_set(DMA_CYCLIC, mask);
atmel_port->chan_rx = dma_request_slave_channel(mfd_dev, "rx"); chan = dma_request_chan(mfd_dev, "rx");
if (atmel_port->chan_rx == NULL) if (IS_ERR(chan)) {
atmel_port->chan_rx = NULL;
goto chan_err; goto chan_err;
}
atmel_port->chan_rx = chan;
dev_info(port->dev, "using %s for rx DMA transfers\n", dev_info(port->dev, "using %s for rx DMA transfers\n",
dma_chan_name(atmel_port->chan_rx)); dma_chan_name(atmel_port->chan_rx));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment