From: claudiu beznea <claudiu.beznea@tuxon.dev>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
Richard Genoud <richard.genoud@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Nicolas Ferre <nicolas.ferre@microchip.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
linux-serial@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] serial: atmel: convert not to use dma_request_slave_channel()
Date: Mon, 20 Nov 2023 08:14:30 +0200 [thread overview]
Message-ID: <ccfcf2a5-c04b-4781-8658-d63044b9b9c6@tuxon.dev> (raw)
In-Reply-To: <f2e9790d8b49aeba8b43ce018d30a35b837ac1eb.1700409299.git.christophe.jaillet@wanadoo.fr>
Hi, Christophe,
On 19.11.2023 17:55, Christophe JAILLET wrote:
> 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>
> ---
> v2: Also update atmel_prepare_rx_dma()
> ---
> drivers/tty/serial/atmel_serial.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 1946fafc3f3e..6aeb4648843b 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -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;
There is no need for this.
> 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;
Ditto
> 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));
>
next prev parent reply other threads:[~2023-11-20 6:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-19 15:55 Christophe JAILLET
2023-11-20 6:14 ` claudiu beznea [this message]
2023-11-20 7:04 ` Jiri Slaby
2023-11-20 7:07 ` Jiri Slaby
2023-11-20 7:12 ` claudiu beznea
2023-11-20 21:19 ` Christophe JAILLET
2023-11-20 16:51 ` Hugo Villeneuve
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ccfcf2a5-c04b-4781-8658-d63044b9b9c6@tuxon.dev \
--to=claudiu.beznea@tuxon.dev \
--cc=alexandre.belloni@bootlin.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=nicolas.ferre@microchip.com \
--cc=richard.genoud@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®