Re: [PATCH 2/2] spi: use dmaengine_get_dma_device() instead of chan->device->dev

From: Mark Brown

Date: Tue Sep 29 2026 - 17:44:22 EST


On Tue, Sep 29, 2026 at 11:54:43AM -0400, Frank.Li@xxxxxxxxxxx wrote:
> From: Frank Li <Frank.Li@xxxxxxx>
>
> Replace direct dma_chan::device::dev access with the proper
> dmaengine_get_dma_device() for consumer API

> @@ -1174,16 +1177,15 @@ static int bcm2835_spi_setup_dma(struct spi_controller *ctlr,
> struct bcm2835_spi *bs,
> struct bcm2835_spidev *target)
> {
> + struct device *rx_dev = dmaengine_get_dma_device(ctlr->dma_rx);
> int ret;
>
> if (!ctlr->dma_rx)
> return 0;
>

This moves the use of dma_rx after the NULL check. Possibly
dmaengine_get_dma_device() will do the right thing but still there's
more updates needed.

> @@ -766,21 +769,21 @@ static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
> static void dspi_release_dma(struct fsl_dspi *dspi)
> {
> struct fsl_dspi_dma *dma = dspi->dma;
> + struct device *tx_dev = dmaengine_get_dma_device(dma->chan_tx);
> + struct device *rx_dev = dmaengine_get_dma_device(dma->chan_rx);
>
> if (!dma)
> return;

Similar issue here, though things are a bit more involved.

Attachment: signature.asc
Description: PGP signature