mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/1] ntb: use dmaengine_desc_set_callback()
@ 2026-11-02 19:57 Frank.Li
  2026-11-02 23:42 ` Dave Jiang
  0 siblings, 1 reply; 2+ messages in thread
From: Frank.Li @ 2026-11-02 19:57 UTC (permalink / raw)
  To: Jon Mason, Dave Jiang, Allen Hubbe, Matt Porter,
	Alexandre Bounine, Frank Li, Andrew Morton, James Kim,
	Dan Carpenter, open list:NTB DRIVER CORE, open list
  Cc: imx, vkoul

From: Frank Li <Frank.Li@nxp.com>

Replace open-coded assignments to callback and callback_param fields
of struct dma_async_tx_descriptor with calls to the
dmaengine_desc_set_callback() helper across ntb drivers.

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

Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/ntb/ntb_transport.c              | 6 ++----
 drivers/ntb/test/ntb_perf.c              | 3 +--
 drivers/rapidio/devices/rio_mport_cdev.c | 3 +--
 3 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index f9caa1a653c5b..370196ecf8f9d 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -1557,8 +1557,7 @@ static int ntb_async_rx_submit(struct ntb_queue_entry *entry, void *offset)
 	if (!txd)
 		goto err_get_unmap;
 
-	txd->callback_result = ntb_rx_copy_callback;
-	txd->callback_param = entry;
+	dmaengine_desc_set_callback(txd, NULL, ntb_rx_copy_callback, entry);
 	dma_set_unmap(txd, unmap);
 
 	cookie = dmaengine_submit(txd);
@@ -1889,8 +1888,7 @@ static int ntb_async_tx_submit(struct ntb_transport_qp *qp,
 	if (!txd)
 		goto err_get_unmap;
 
-	txd->callback_result = ntb_tx_copy_callback;
-	txd->callback_param = entry;
+	dmaengine_desc_set_callback(txd, NULL, ntb_tx_copy_callback, entry);
 	dma_set_unmap(txd, unmap);
 
 	cookie = dmaengine_submit(txd);
diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
index dfd175f79e8f0..862b3dffa2b17 100644
--- a/drivers/ntb/test/ntb_perf.c
+++ b/drivers/ntb/test/ntb_perf.c
@@ -834,8 +834,7 @@ static int perf_copy_chunk(struct perf_thread *pthr,
 		goto err_free_resource;
 	}
 
-	tx->callback = perf_dma_copy_callback;
-	tx->callback_param = pthr;
+	dmaengine_desc_set_callback(tx, perf_dma_copy_callback, NULL, pthr);
 	dma_set_unmap(tx, unmap);
 
 	ret = dma_submit_error(dmaengine_submit(tx));
diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index 40d2953a9a7f9..585e3f9ff29ca 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -717,8 +717,7 @@ static int do_dma_request(struct mport_dma_req *req,
 		goto err_out;
 	}
 
-	tx->callback = dma_xfer_callback;
-	tx->callback_param = req;
+	dmaengine_desc_set_callback(tx, dma_xfer_callback, NULL, req);
 
 	req->status = DMA_IN_PROGRESS;
 	kref_get(&req->refcount);
-- 
2.43.0


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

end of thread, other threads:[~2026-11-02 23:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02 19:57 [PATCH 1/1] ntb: use dmaengine_desc_set_callback() Frank.Li
2026-11-02 23:42 ` Dave Jiang

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

all inboxes | Powered by JetHome®