Re: [PATCH 1/1] tty: serial: use dmaengine_desc_set_callback()

From: Nicolai Buchwitz

Date: Tue Nov 03 2026 - 07:40:26 EST


Hi Frank

On 2.11.2026 18:54, Frank.Li@xxxxxxxxxxx wrote:
From: Frank Li <Frank.Li@xxxxxxx>

Replace open-coded assignments to callback and callback_param fields
of struct dma_async_tx_descriptor with calls to the
dmaengine_desc_set_callback() helper across serial drivers.

No functional change intended. Prepare to make struct
dma_async_tx_descriptor private to the DMA engine.

Signed-off-by: Frank Li <Frank.Li@xxxxxxx>
---
drivers/tty/serial/8250/8250_dma.c | 6 ++----
drivers/tty/serial/8250/8250_mtk.c | 3 +--
drivers/tty/serial/8250/8250_omap.c | 6 ++----
drivers/tty/serial/amba-pl011.c | 6 ++----
drivers/tty/serial/atmel_serial.c | 6 ++----
drivers/tty/serial/fsl_lpuart.c | 6 ++----
drivers/tty/serial/imx.c | 6 ++----
drivers/tty/serial/msm_serial.c | 6 ++----
drivers/tty/serial/mxs-auart.c | 6 ++----
drivers/tty/serial/pch_uart.c | 6 ++----
drivers/tty/serial/samsung_tty.c | 6 ++----
drivers/tty/serial/serial-tegra.c | 6 ++----
drivers/tty/serial/sh-sci.c | 9 +++------
drivers/tty/serial/sprd_serial.c | 3 +--
drivers/tty/serial/stm32-usart.c | 6 ++----
15 files changed, 29 insertions(+), 58 deletions(-)

[...]

diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index e6f652905ca6f..e7373cd11b621 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -715,8 +715,7 @@ static int pl011_dma_tx_refill(struct uart_amba_port *uap)
}

/* Some data to go along to the callback */
- desc->callback = pl011_dma_tx_callback;
- desc->callback_param = uap;
+ dmaengine_desc_set_callback(desc, pl011_dma_tx_callback, NULL, uap);

/* All errors should happen at prepare time */
dmaengine_submit(desc);
@@ -906,8 +905,7 @@ static int pl011_dma_rx_trigger_dma(struct uart_amba_port *uap)
}

/* Some data to go along to the callback */
- desc->callback = pl011_dma_rx_callback;
- desc->callback_param = uap;
+ dmaengine_desc_set_callback(desc, pl011_dma_rx_callback, NULL, uap);
dmarx->cookie = dmaengine_submit(desc);
dma_async_issue_pending(rxchan);

[...]

Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx> # amba-pl011

Thanks,
Nicolai