Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 1/1] PCI: Replace chan->device->dev with dmaengine_get_provider_device()
@ 2026-11-04 15:01 Frank.Li
  2026-11-04 15:05 ` sashiko-bot
  2026-11-04 20:46 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Frank.Li @ 2026-11-04 15:01 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Koichiro Den,
	Niklas Cassel, Andy Shevchenko, Christian Bruel,
	open list:MHI BUS, open list:MHI BUS,
	open list:PCI ENDPOINT SUBSYSTEM, open list
  Cc: imx, 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>
---
Change in v2
- remove Assisted-by: LLM
- fix indention
---
 drivers/pci/endpoint/functions/pci-epf-mhi.c  | 4 ++--
 drivers/pci/endpoint/functions/pci-epf-test.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c
index 78f1fb1a6b0c7..80b4622446fcf 100644
--- a/drivers/pci/endpoint/functions/pci-epf-mhi.c
+++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c
@@ -646,8 +646,8 @@ static bool pci_epf_mhi_filter(struct dma_chan *chan, void *node)
 	memset(&caps, 0, sizeof(caps));
 	dma_get_slave_caps(chan, &caps);
 
-	return chan->device->dev == filter->dev && filter->dma_mask &
-					caps.directions;
+	return dmaengine_get_provider_device(chan) == filter->dev &&
+	       (filter->dma_mask & caps.directions);
 }
 
 static int pci_epf_mhi_dma_init(struct pci_epf_mhi *epf_mhi)
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c b/drivers/pci/endpoint/functions/pci-epf-test.c
index d4905aa8e4c01..ba2bc0c2f3f9c 100644
--- a/drivers/pci/endpoint/functions/pci-epf-test.c
+++ b/drivers/pci/endpoint/functions/pci-epf-test.c
@@ -238,8 +238,8 @@ static bool epf_dma_filter_fn(struct dma_chan *chan, void *node)
 	memset(&caps, 0, sizeof(caps));
 	dma_get_slave_caps(chan, &caps);
 
-	return chan->device->dev == filter->dev
-		&& (filter->dma_mask & caps.directions);
+	return dmaengine_get_provider_device(chan) == filter->dev &&
+	       (filter->dma_mask & caps.directions);
 }
 
 /**
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/1] PCI: Replace chan->device->dev with dmaengine_get_provider_device()
  2026-11-04 15:01 [PATCH v2 1/1] PCI: Replace chan->device->dev with dmaengine_get_provider_device() Frank.Li
@ 2026-11-04 15:05 ` sashiko-bot
  2026-11-04 20:46 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-11-04 15:05 UTC (permalink / raw)
  To: Frank.Li, open list:PCI ENDPOINT SUBSYSTEM

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

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261104150202.3224971-1-Frank.Li@oss.nxp.com?part=1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2 1/1] PCI: Replace chan->device->dev with dmaengine_get_provider_device()
  2026-11-04 15:01 [PATCH v2 1/1] PCI: Replace chan->device->dev with dmaengine_get_provider_device() Frank.Li
  2026-11-04 15:05 ` sashiko-bot
@ 2026-11-04 20:46 ` Andy Shevchenko
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-11-04 20:46 UTC (permalink / raw)
  To: Frank.Li
  Cc: Manivannan Sadhasivam, Jeff Hugo, Krzysztof Wilczyński,
	Kishon Vijay Abraham I, Frank Li, Bjorn Helgaas, Koichiro Den,
	Niklas Cassel, Christian Bruel, open list:MHI BUS,
	open list:MHI BUS, open list:PCI ENDPOINT SUBSYSTEM, open list,
	imx, Frank Li

On Wed, Nov 04, 2026 at 10:01:59AM -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.

I would also make line lengths balanced

  No functional change. Prepare make to struct dma_device private
  to the DMA engine.

Either way,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-04 20:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-04 15:01 [PATCH v2 1/1] PCI: Replace chan->device->dev with dmaengine_get_provider_device() Frank.Li
2026-11-04 15:05 ` sashiko-bot
2026-11-04 20:46 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox