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 > Cc: Richard Genoud > Cc: Nicolas Ferre > Cc: Alexandre Belloni > Cc: Claudiu Beznea > Cc: Vladimir Zapolskiy > Cc: Liviu Dudau > Cc: Sudeep Holla > Cc: Lorenzo Pieralisi > Cc: Shawn Guo > Cc: Sascha Hauer > Cc: Pengutronix Kernel Team > Cc: Fabio Estevam > Cc: NXP Linux Team > Cc: "Andreas Färber" > Cc: Manivannan Sadhasivam > Signed-off-by: Jiri Slaby > --- > 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 -- i.