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

Mark Brown broonie at kernel.org
Tue Sep 29 14:43:55 PDT 2026


On Tue, Sep 29, 2026 at 11:54:43AM -0400, Frank.Li at oss.nxp.com wrote:
> From: Frank Li <Frank.Li at nxp.com>
> 
> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260929/e50ae052/attachment.sig>


More information about the linux-arm-kernel mailing list