Re: [PATCH 1/1] spi: replace chan->device->dev with dmaengine_get_provider_device()

From: Andy Shevchenko

Date: Wed Nov 04 2026 - 03:49:45 EST


On Tue, Nov 03, 2026 at 04:58:23PM -0500, Frank.Li@xxxxxxxxxxx wrote:

> Use the dmaengine_get_provider_device() API instead of directly
> accessing chan->device->dev to get the DMA provider device.
>
> No functional change. Prepare make to struct dma_device private to the DMA
> engine.

...

> struct dw_dma_slave *s = param;
>
> - if (s->dma_dev != chan->device->dev)
> + if (s->dma_dev != dmaengine_get_provider_device(chan))
> return false;

It's obvious that we need another helper to match.

// void * and EXPORT to be able to use as filter function
bool dmaengine_match_provider_device(struct dma_chan *chan, void *dma_dev)
{
return dmaengine_get_provider_device(chan) == dma_dev;
}
EXPORT_SYMBOL_GPL(dmaengine_match_provider_device);

...

> static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param)
> {
> - return param == chan->device->dev;
> + return param == dmaengine_get_provider_device(chan);
> }

With that being done this function is gone.

--
With Best Regards,
Andy Shevchenko