[Linux-stm32] [PATCH 1/1] spi: use dmaengine_desc_set_callback()

Heiko Stübner heiko at sntech.de
Thu Nov 5 10:52:38 CET 2026


Am Montag, 2. November 2026, 18:39:58 Mitteleuropäische Normalzeit schrieb Frank.Li at oss.nxp.com:
> From: Frank Li <Frank.Li at nxp.com>
> 
> 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 SPI bus drivers.
> 
> No functional change intended. Prepare make to struct
> dma_async_tx_descriptor private to the DMA engine.
> 
> Signed-off-by: Frank Li <Frank.Li at nxp.com>

[...]

> diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
> index 1a81fd94b4396..f8d6cea2f3dad 100644
> --- a/drivers/spi/spi-rockchip.c
> +++ b/drivers/spi/spi-rockchip.c
> @@ -475,8 +475,7 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs,
>  		if (!rxdesc)
>  			return -EINVAL;
>  
> -		rxdesc->callback = rockchip_spi_dma_rxcb;
> -		rxdesc->callback_param = ctlr;
> +		dmaengine_desc_set_callback(rxdesc, rockchip_spi_dma_rxcb, NULL, ctlr);
>  	}
>  
>  	txdesc = NULL;
> @@ -500,8 +499,7 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs,
>  			return -EINVAL;
>  		}
>  
> -		txdesc->callback = rockchip_spi_dma_txcb;
> -		txdesc->callback_param = ctlr;
> +		dmaengine_desc_set_callback(txdesc, rockchip_spi_dma_txcb, NULL, ctlr);
>  	}
>  
>  	/* rx must be started before tx due to spi instinct */

Reviewed-by: Heiko Stuebner <heiko at sntech.de>




More information about the Linux-stm32 mailing list