* [PATCH 1/1] spi: replace chan->device->dev with dmaengine_get_provider_device()
@ 2026-11-03 21:58 Frank.Li
2026-11-04 8:46 ` Andy Shevchenko
0 siblings, 1 reply; 3+ messages in thread
From: Frank.Li @ 2026-11-03 21:58 UTC (permalink / raw)
To: Mark Brown, Andy Shevchenko, Daniel Mack, Haojian Zhuang,
Robert Jarzmik, open list:SPI SUBSYSTEM, open list,
moderated list:PXA2xx/PXA3xx SUPPORT
Cc: imx, vkoul, Frank Li
From: Frank Li <Frank.Li@nxp.com>
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.
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
drivers/spi/spi-dw-dma.c | 2 +-
drivers/spi/spi-pxa2xx-pci.c | 2 +-
drivers/spi/spi-pxa2xx-platform.c | 2 +-
drivers/spi/spi-topcliff-pch.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c
index b706770334a61..a655026071729 100644
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -27,7 +27,7 @@ static bool dw_spi_dma_chan_filter(struct dma_chan *chan, void *param)
{
struct dw_dma_slave *s = param;
- if (s->dma_dev != chan->device->dev)
+ if (s->dma_dev != dmaengine_get_provider_device(chan))
return false;
chan->private = s;
diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index cae77ac185206..de790e94f493f 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -81,7 +81,7 @@ static bool lpss_dma_filter(struct dma_chan *chan, void *param)
{
struct dw_dma_slave *dws = param;
- if (dws->dma_dev != chan->device->dev)
+ if (dws->dma_dev != dmaengine_get_provider_device(chan))
return false;
chan->private = dws;
diff --git a/drivers/spi/spi-pxa2xx-platform.c b/drivers/spi/spi-pxa2xx-platform.c
index 849a14cd0343c..8e90bbf74350d 100644
--- a/drivers/spi/spi-pxa2xx-platform.c
+++ b/drivers/spi/spi-pxa2xx-platform.c
@@ -14,7 +14,7 @@
static bool pxa2xx_spi_idma_filter(struct dma_chan *chan, void *param)
{
- return param == chan->device->dev;
+ return param == dmaengine_get_provider_device(chan);
}
static int
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 1f53d62f37267..b5aa52596ecb4 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -808,7 +808,7 @@ static bool pch_spi_filter(struct dma_chan *chan, void *slave)
struct pch_dma_slave *param = slave;
if ((chan->chan_id == param->chan_id) &&
- (param->dma_dev == chan->device->dev)) {
+ (param->dma_dev == dmaengine_get_provider_device(chan))) {
chan->private = param;
return true;
} else {
--
2.43.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] spi: replace chan->device->dev with dmaengine_get_provider_device()
2026-11-03 21:58 [PATCH 1/1] spi: replace chan->device->dev with dmaengine_get_provider_device() Frank.Li
@ 2026-11-04 8:46 ` Andy Shevchenko
2026-11-04 14:41 ` Frank Li
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-11-04 8:46 UTC (permalink / raw)
To: Frank.Li
Cc: Mark Brown, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
open list:SPI SUBSYSTEM, open list,
moderated list:PXA2xx/PXA3xx SUPPORT, imx, vkoul, Frank Li
On Tue, Nov 03, 2026 at 04:58:23PM -0500, Frank.Li@oss.nxp.com 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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] spi: replace chan->device->dev with dmaengine_get_provider_device()
2026-11-04 8:46 ` Andy Shevchenko
@ 2026-11-04 14:41 ` Frank Li
0 siblings, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-11-04 14:41 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Mark Brown, Daniel Mack, Haojian Zhuang, Robert Jarzmik,
open list:SPI SUBSYSTEM, open list,
moderated list:PXA2xx/PXA3xx SUPPORT, imx, vkoul, Frank Li
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@oss.nxp.com 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
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-04 14:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 21:58 [PATCH 1/1] spi: replace chan->device->dev with dmaengine_get_provider_device() Frank.Li
2026-11-04 8:46 ` Andy Shevchenko
2026-11-04 14:41 ` Frank Li
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®