[PATCH 1/1] mtd: use dmaengine_desc_set_callback()

sashiko-bot at kernel.org sashiko-bot at kernel.org
Mon Nov 2 10:21:00 PST 2026


Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] mtd: implicit declaration of dmaengine_desc_set_callback() breaks build
- [Low] mtd: commit message inaccurately states change is across sound drivers
--

commit 32484e960f1ce7c6c67c27f2bc2a6a6370f61c59
Author: Frank Li <Frank.Li at nxp.com>

mtd: use dmaengine_desc_set_callback()

This commit replaces open-coded assignments to the callback and
callback_param fields of struct dma_async_tx_descriptor with calls to
dmaengine_desc_set_callback() across 14 MTD drivers.

>     mtd: use dmaengine_desc_set_callback()
>     
>     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 sound 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 at nxp.com>

[Severity: Low]
This isn't a bug, but the commit message says "across sound drivers" when all
14 modified files are MTD drivers under drivers/mtd/. Should this say "across
MTD drivers" instead?

> diff --git a/drivers/mtd/hyperbus/hbmc-am654.c b/drivers/mtd/hyperbus/hbmc-am654.c
> index 8a14e908d0b53..56b265125c7e8 100644
> --- a/drivers/mtd/hyperbus/hbmc-am654.c
> +++ b/drivers/mtd/hyperbus/hbmc-am654.c
> @@ -100,8 +100,7 @@ static int am654_hbmc_dma_read(struct am654_hbmc_device_priv *priv, void *to,
>  	}
>  
>  	reinit_completion(&priv->rx_dma_complete);
> -	tx->callback = am654_hbmc_dma_callback;
> -	tx->callback_param = priv;
> +	dmaengine_desc_set_callback(tx, am654_hbmc_dma_callback, NULL, priv);

[Severity: High]
Does this break the build for these MTD drivers?

In include/linux/dmaengine.h, struct dma_async_tx_descriptor still defines the
callback fields directly:

    dma_async_tx_callback callback;
    dma_async_tx_callback_result callback_result;
    void *callback_param;

and dmaengine_desc_set_callback() is neither declared nor defined anywhere in
include/linux/dmaengine.h or the kernel tree at this commit.

Building any of the 14 modified drivers fails with an implicit declaration of
function dmaengine_desc_set_callback() error in:

  - drivers/mtd/hyperbus/hbmc-am654.c: am654_hbmc_dma_read()
  - drivers/mtd/nand/onenand/onenand_omap2.c: omap2_onenand_dma_transfer()
  - drivers/mtd/nand/qpic_common.c: qcom_submit_descs()
  - drivers/mtd/nand/raw/atmel/nand-controller.c: atmel_nand_dma_transfer()
  - drivers/mtd/nand/raw/cadence-nand-controller.c: cadence_nand_slave_dma_transfer()
  - drivers/mtd/nand/raw/fsmc_nand.c: dma_xfer()
  - drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c: gpmi_nfc_exec_op()
  - drivers/mtd/nand/raw/intel-nand-controller.c: ebu_dma_start()
  - drivers/mtd/nand/raw/loongson-nand-controller.c: loongson_nand_dma_transfer()
  - drivers/mtd/nand/raw/lpc32xx_mlc.c: lpc32xx_xmit_dma()
  - drivers/mtd/nand/raw/lpc32xx_slc.c: lpc32xx_xmit_dma()
  - drivers/mtd/nand/raw/omap2.c: omap_nand_dma_transfer()
  - drivers/mtd/nand/raw/sh_flctl.c: flctl_dma_fifo0_transfer()
  - drivers/mtd/nand/raw/stm32_fmc2_nand.c: stm32_fmc2_nfc_xfer()

Is this commit missing a prerequisite patch that introduces
dmaengine_desc_set_callback() in include/linux/dmaengine.h?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261102181406.3994422-1-Frank.Li@oss.nxp.com?part=1



More information about the linux-mtd mailing list