Re: [PATCH 1/1] spi: use dmaengine_desc_set_callback()
From: Heiko Stübner
Date: Thu Nov 05 2026 - 05:07:55 EST
Am Montag, 2. November 2026, 18:39:58 Mitteleuropäische Normalzeit schrieb Frank.Li@xxxxxxxxxxx:
> 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 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@xxxxxxx>
[...]
> 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@xxxxxxxxx>