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

From: Frank Li

Date: Wed Nov 04 2026 - 09:45:52 EST


On Wed, Nov 04, 2026 at 10:46:02AM +0200, Andy Shevchenko wrote:
> 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);
>

Yes, I can submit Add API patch first. It cross multi subsystems, it'd
better put this optimizate at next version and leave it as it now. Others
depend on dma engine patch to make merge complex. and there are not much
files.

Frank

> ...
>
> > 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
>
>