Skip to contentSkip to conversation

PCI: replace chan->device->dev with dmaengine_get_provider_device()

PATCH In review [email protected] 3 participants 3 messages Nov 3 – Nov 4

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: replace chan->device->dev with dmaengine_get_provider_device()

From: Frank Li <[email protected]>

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.

Assisted-by LLM
---
 drivers/pci/endpoint/functions/pci-epf-mhi.c  | 2 +-
 drivers/pci/endpoint/functions/pci-epf-test.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/pci/endpoint/functions/pci-epf-mhi.c +1 -1
index 78f1fb1a6b0c7..5677fcbfe44f7 100644
@@ -646,7 +646,7 @@ 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 &
+	return dmaengine_get_provider_device(chan) == filter->dev && filter->dma_mask &
 					caps.directions;
 }
 
drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
index d4905aa8e4c01..fd63e423c4726 100644
@@ -238,7 +238,7 @@ 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
+	return dmaengine_get_provider_device(chan) == filter->dev
 		&& (filter->dma_mask & caps.directions);
 }
 
Signature · 1 line
2.43.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 10 lines

From: Frank Li <[email protected]>

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.

Assisted-by LLM

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
#2 lore raw
In reply to [email protected]
Quoted 6 lines · On Tue, Nov 03, 2026 at 04:29:20PM -0500, [email protected] 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.

...

Quoted 1 line
Assisted-by LLM

It's an obsolete tag. Please, replace it in a free-form explanation how AI was used in the comment block, below '---' line.

Quoted 2 lines

---

...

drivers/pci/endpoint/functions/pci-epf-mhi.c static bool pci_epf_mhi_filter(struct dma_chan *chan, void *node) · line 650

Quoted 8 lines

static bool pci_epf_mhi_filter(struct dma_chan *chan, void *node)

drivers/pci/endpoint/functions/pci-epf-mhi.c +1 -1
 	memset(&caps, 0, sizeof(caps));
 	dma_get_slave_caps(chan, &caps);
 
-	return chan->device->dev == filter->dev && filter->dma_mask &
+	return dmaengine_get_provider_device(chan) == filter->dev && filter->dma_mask &
 					caps.directions;

While at it, fix indentation:

	return dmaengine_get_provider_device(chan) == filter->dev &&
	       (filter->dma_mask & caps.directions);

...

drivers/pci/endpoint/functions/pci-epf-test.c static bool epf_dma_filter_fn(struct dma_chan *chan, void *node) · line 242

Quoted 8 lines

static bool epf_dma_filter_fn(struct dma_chan *chan, void *node)

drivers/pci/endpoint/functions/pci-epf-test.c +1 -1
 	memset(&caps, 0, sizeof(caps));
 	dma_get_slave_caps(chan, &caps);
 
-	return chan->device->dev == filter->dev
+	return dmaengine_get_provider_device(chan) == filter->dev
 		&& (filter->dma_mask & caps.directions);

Ditto.

	return dmaengine_get_provider_device(chan) == filter->dev &&
	       (filter->dma_mask & caps.directions);

...

Looking more at it, you probably want to deduplicate this code at some point.

Signature · 2 lines
With Best Regards,
Andy Shevchenko