Re: [PATCH 1/1] NTB: ntb_transport: replace direct ->device_prep*() calls with standard DMA engine API

From: Dave Jiang

Date: Thu Sep 17 2026 - 17:08:01 EST




On 9/17/26 12:08 PM, Frank.Li@xxxxxxxxxxx wrote:
> From: Frank Li <Frank.Li@xxxxxxx>
>
> DMA engine consumers must not call the channel's device_prep_*() function
> pointers directly. Use the standard dmaengine wrapper APIs instead.
>
> Assisted-by: LLM
> Signed-off-by: Frank Li <Frank.Li@xxxxxxx>

Reviewed-by: Dave Jiang <dave.jiang@xxxxxxxxx>

> ---
> drivers/ntb/ntb_transport.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index f9caa1a653c5b..45144abfb7aad 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -1551,9 +1551,9 @@ static int ntb_async_rx_submit(struct ntb_queue_entry *entry, void *offset)
>
> unmap->from_cnt = 1;
>
> - txd = device->device_prep_dma_memcpy(chan, unmap->addr[1],
> - unmap->addr[0], len,
> - DMA_PREP_INTERRUPT);
> + txd = dmaengine_prep_dma_memcpy(chan, unmap->addr[1],
> + unmap->addr[0], len,
> + DMA_PREP_INTERRUPT);
> if (!txd)
> goto err_get_unmap;
>
> @@ -1884,8 +1884,8 @@ static int ntb_async_tx_submit(struct ntb_transport_qp *qp,
>
> unmap->to_cnt = 1;
>
> - txd = device->device_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
> - DMA_PREP_INTERRUPT);
> + txd = dmaengine_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
> + DMA_PREP_INTERRUPT);
> if (!txd)
> goto err_get_unmap;
>