[PATCH 2/3] net: xilinx: axienet: use dmaengine_prep_slave_sg_context()

Gupta, Suraj suraj.gupta2 at amd.com
Sun Nov 8 23:33:29 PST 2026



On 11/7/2026 4:13 AM, Frank.Li at oss.nxp.com wrote:
> From: Frank Li <Frank.Li at nxp.com>
> 
> Replace the direct call to dma_dev->device_prep_slave_sg() with the
> dmaengine_prep_slave_sg_context() helper, which handles NULL checks and
> passes the context pointer cleanly.
> 
> No functional change. Prepare to make struct dma_device private to the DMA
> engine.
> 
> Signed-off-by: Frank Li <Frank.Li at nxp.com>
> ---
> Suggest go through DMA engine tree. this is only one of 3 user, which
> use context at prep sg.
> ---
>   drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index 7e83c4b5f1931..55d1b39caf7ed 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -1006,9 +1006,10 @@ axienet_start_xmit_dmaengine(struct sk_buff *skb, struct net_device *ndev)
>   		app_metadata[0] |= 2; /* Tx Full Checksum Offload Enabled */
>   	}
>   
> -	dma_tx_desc = dma_dev->device_prep_slave_sg(lp->tx_chan, skbuf_dma->sgl,
> -			sg_len, DMA_MEM_TO_DEV,
> -			DMA_PREP_INTERRUPT, (void *)app_metadata);
> +	dma_tx_desc = dmaengine_prep_slave_sg_context(lp->tx_chan, skbuf_dma->sgl,
> +						      sg_len, DMA_MEM_TO_DEV,
> +						      DMA_PREP_INTERRUPT,
> +						      (void *)app_metadata);

After this change, dma_dev looks unused & can be removed. Shashiko bot 
also pointed same.

Thanks,
Suraj


>   	if (!dma_tx_desc)
>   		goto xmit_error_unmap_sg;
>   
> 




More information about the linux-arm-kernel mailing list