Skip to contentSkip to conversation

NTB: ntb_transport: replace direct ->device_prep*() calls with standard DMA engine API

PATCH Superseded [email protected] 2 participants 2 messages Sep 17

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 NTB: ntb_transport: replace direct ->device_prep*() calls with standard DMA engine API

From: Frank Li <[email protected]>

DMA engine consumers must not call the channel's device_prep_*() function pointers directly. Use the standard dmaengine wrapper APIs instead.

Assisted-by LLM
---
 drivers/ntb/ntb_transport.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/ntb/ntb_transport.c +5 -5
index f9caa1a653c5b..45144abfb7aad 100644
@@ -1551,9 +1551,9 @@ static int ntb_async_rx_submit(struct ntb_queue_entry *entry, void *offset)
 
 	unmap->from_cnt = 1;
 
-	txd = device->device_prep_dma_memcpy(chan, unmap->addr[1],
-					     unmap->addr[0], len,
-					     DMA_PREP_INTERRUPT);
+	txd = dmaengine_prep_dma_memcpy(chan, unmap->addr[1],
+					unmap->addr[0], len,
+					DMA_PREP_INTERRUPT);
 	if (!txd)
 		goto err_get_unmap;
 
@@ -1884,8 +1884,8 @@ static int ntb_async_tx_submit(struct ntb_transport_qp *qp,
 
 	unmap->to_cnt = 1;
 
-	txd = device->device_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
-					     DMA_PREP_INTERRUPT);
+	txd = dmaengine_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
+					DMA_PREP_INTERRUPT);
 	if (!txd)
 		goto err_get_unmap;
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · On 9/17/26 12:08 PM, [email protected] wrote:

From: Frank Li <[email protected]>

DMA engine consumers must not call the channel's device_prep_*() function pointers directly. Use the standard dmaengine wrapper APIs instead.

Assisted-by LLM
Quoted 32 lines
---
 drivers/ntb/ntb_transport.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/ntb/ntb_transport.c +5 -5
index f9caa1a653c5b..45144abfb7aad 100644
@@ -1551,9 +1551,9 @@ static int ntb_async_rx_submit(struct ntb_queue_entry *entry, void *offset)
 
 	unmap->from_cnt = 1;
 
-	txd = device->device_prep_dma_memcpy(chan, unmap->addr[1],
-					     unmap->addr[0], len,
-					     DMA_PREP_INTERRUPT);
+	txd = dmaengine_prep_dma_memcpy(chan, unmap->addr[1],
+					unmap->addr[0], len,
+					DMA_PREP_INTERRUPT);
 	if (!txd)
 		goto err_get_unmap;
 
@@ -1884,8 +1884,8 @@ static int ntb_async_tx_submit(struct ntb_transport_qp *qp,
 
 	unmap->to_cnt = 1;
 
-	txd = device->device_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
-					     DMA_PREP_INTERRUPT);
+	txd = dmaengine_prep_dma_memcpy(chan, dest, unmap->addr[0], len,
+					DMA_PREP_INTERRUPT);
 	if (!txd)
 		goto err_get_unmap;