PCI: replace chan->device->dev with dmaengine_get_provider_device()
Subsystems (5)
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.
--- 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
@@ -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
@@ -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
[email protected]
AI reviewSashiko 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 accessingchan->device->devto get the DMA provider device.No functional change. Prepare make to struct
dma_deviceprivate to the DMA engine.Assisted-by LLMSigned-off-by Frank Li <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
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 accessingchan->device->devto get the DMA provider device.No functional change. Prepare make to struct
dma_deviceprivate 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
Signed-off-by Frank Li <[email protected]>---
...
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
-1memset (&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
-1memset (&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