Skip to contentSkip to conversation

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

PATCH Applied [email protected] 3 participants 3 messages Nov 30 – Dec 2

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

PATCH v2 1/1 nvmet: 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 intended. Prepare to make struct dma_device private to the DMA engine.

---
Change in v2
- correct tag nvmet
- change to prepare to make ...
- remove Assisted-by: LLM

---
 drivers/nvme/target/pci-epf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/pci-epf.c +1 -1
index 4199fead04ff3..ffb42244cc233 100644
@@ -281,7 +281,7 @@ static bool nvmet_pci_epf_dma_filter(struct dma_chan *chan, void *arg)
 	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
Reviewed-by on v2 1/1
#1 lore raw
Quoted 34 lines · On Mon, Nov 30, 2026 at 11:54:01AM -0500, [email protected] wrote:

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 intended. Prepare to make struct dma_device private to the DMA engine.

---
Change in v2
- correct tag nvmet
- change to prepare to make ...
- remove Assisted-by: LLM

---
 drivers/nvme/target/pci-epf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/pci-epf.c +1 -1
index 4199fead04ff3..ffb42244cc233 100644
@@ -281,7 +281,7 @@ static bool nvmet_pci_epf_dma_filter(struct dma_chan *chan, void *arg)
 	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
maintainer Applied
#2 lore raw
In reply to [email protected]
Quoted 8 lines · On Mon, 30 Nov 2026 11:54:01 -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 intended. Prepare to make struct dma_device private to the DMA engine.

[...]

Thanks, applied to nvme-7.5.

[1/1] nvmet: replace chan->device->dev with dmaengine_get_provider_device()

      commit: 0e6b3974404416c245142586c3e94de0306f59fd

--
Keith Busch <[email protected]>