[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87251b8a-d955-e6dd-94df-c7621e72bac@linux.intel.com>
Date: Tue, 20 Sep 2022 11:54:12 +0300 (EEST)
From: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
To: Jiri Slaby <jslaby@...e.cz>
cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
linux-serial <linux-serial@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Tobias Klauser <tklauser@...tanz.ch>,
Richard Genoud <richard.genoud@...il.com>,
Nicolas Ferre <nicolas.ferre@...rochip.com>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Claudiu Beznea <claudiu.beznea@...rochip.com>,
Vladimir Zapolskiy <vz@...ia.com>,
Liviu Dudau <liviu.dudau@....com>,
Sudeep Holla <sudeep.holla@....com>,
Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Andreas Färber <afaerber@...e.de>,
Manivannan Sadhasivam <mani@...nel.org>
Subject: Re: [PATCH v4 09/10] tty: serial: use uart_port_tx() helper
On Tue, 20 Sep 2022, Jiri Slaby wrote:
> uart_port_tx() is a new helper to send characters to the device. Use it
> in these drivers.
>
> Cc: Tobias Klauser <tklauser@...tanz.ch>
> Cc: Richard Genoud <richard.genoud@...il.com>
> Cc: Nicolas Ferre <nicolas.ferre@...rochip.com>
> Cc: Alexandre Belloni <alexandre.belloni@...tlin.com>
> Cc: Claudiu Beznea <claudiu.beznea@...rochip.com>
> Cc: Vladimir Zapolskiy <vz@...ia.com>
> Cc: Liviu Dudau <liviu.dudau@....com>
> Cc: Sudeep Holla <sudeep.holla@....com>
> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
> Cc: Shawn Guo <shawnguo@...nel.org>
> Cc: Sascha Hauer <s.hauer@...gutronix.de>
> Cc: Pengutronix Kernel Team <kernel@...gutronix.de>
> Cc: Fabio Estevam <festevam@...il.com>
> Cc: NXP Linux Team <linux-imx@....com>
> Cc: "Andreas Färber" <afaerber@...e.de>
> Cc: Manivannan Sadhasivam <mani@...nel.org>
> Signed-off-by: Jiri Slaby <jslaby@...e.cz>
> ---
> diff --git a/drivers/tty/serial/mcf.c b/drivers/tty/serial/mcf.c
> index b1cd9a76dd93..53b642ea46ba 100644
> --- a/drivers/tty/serial/mcf.c
> +++ b/drivers/tty/serial/mcf.c
> @@ -327,29 +327,13 @@ static void mcf_rx_chars(struct mcf_uart *pp)
> static void mcf_tx_chars(struct mcf_uart *pp)
> {
> struct uart_port *port = &pp->port;
> - struct circ_buf *xmit = &port->state->xmit;
> -
> - if (port->x_char) {
> - /* Send special char - probably flow control */
> - writeb(port->x_char, port->membase + MCFUART_UTB);
> - port->x_char = 0;
> - port->icount.tx++;
> - return;
> - }
> -
> - while (readb(port->membase + MCFUART_USR) & MCFUART_USR_TXREADY) {
> - if (uart_circ_empty(xmit))
> - break;
> - writeb(xmit->buf[xmit->tail], port->membase + MCFUART_UTB);
> - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE -1);
> - port->icount.tx++;
> - }
> -
> - if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
> - uart_write_wakeup(port);
> + unsigned int pending;
> + u8 ch;
>
> - if (uart_circ_empty(xmit)) {
> - mcf_stop_tx(port);
> + pending = uart_port_tx(port, ch,
> + readb(port->membase + MCFUART_USR) & MCFUART_USR_TXREADY,
> + writeb(ch, port->membase + MCFUART_UTB));
> + if (!pending) {
Why unsigned int pending here and bool pending in the other cases?
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
--
i.
Powered by blists - more mailing lists