diff mbox series

[1/7] serial: 8250_dma: Use ->tx_dma function pointer to start next DMA

Message ID 20220310161650.289387-2-miquel.raynal@bootlin.com
State New
Headers show
Series RZN1 UART DMA support | expand

Commit Message

Miquel Raynal March 10, 2022, 4:16 p.m. UTC
From: Phil Edworthy <phil.edworthy@renesas.com>

The 8250 driver is quite flexible. Regarding DMA handling, there is the
possibility to either use the default helper (serial8250_tx_dma()) or
call a specific function. Only the omap and brcm implementation do
that. In both cases, they don't use the serial8250_tx_dma() helper at
all.

As we are going to write a new DMA handling function for the RZ/N1 SoCs
which will use the serial8250_tx_dma() implementation (preceded by a
couple of register writes), we need the ->tx_dma() pointer to link to
our own function, but within the __dma_tx_complete() helper we also need
to call our own implementation instead of the default one directly.

In order to do that, let's call ->tx_dma() instead of
serial8250_tx_dma() from __dma_tx_complete().

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
[miquel.raynal@bootlin.com: Re-write commit message]
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/tty/serial/8250/8250_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/tty/serial/8250/8250_dma.c b/drivers/tty/serial/8250/8250_dma.c
index 890fa7ddaa7f..a0563f2341ac 100644
--- a/drivers/tty/serial/8250/8250_dma.c
+++ b/drivers/tty/serial/8250/8250_dma.c
@@ -33,7 +33,7 @@  static void __dma_tx_complete(void *param)
 	if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
 		uart_write_wakeup(&p->port);
 
-	ret = serial8250_tx_dma(p);
+	ret = dma->tx_dma(p);
 	if (ret)
 		serial8250_set_THRI(p);