mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank.Li@oss.nxp.com
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Chen-Yu Tsai <wens@kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Samuel Holland <samuel@sholland.org>,
	Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	Michal Simek <michal.simek@amd.com>,
	Stephan Gerhold <stephan@gerhold.net>,
	Loic Poulain <loic.poulain@oss.qualcomm.com>,
	Sergey Ryazanov <ryazanov.s.a@gmail.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	Frank Li <Frank.Li@nxp.com>,
	Andre Przywara <andre.przywara@arm.com>,
	Li Youhong <liyouhong@kylinos.cn>, Joe Damato <joe@dama.to>,
	Arnd Bergmann <arnd@arndb.de>,
	bui duc phuc <phucduc.bui@gmail.com>,
	Yicong Hui <yiconghui@gmail.com>, Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org (open list:NETWORKING DRIVERS),
	linux-arm-kernel@lists.infradead.org (moderated
	list:ARM/Allwinner sunXi SoC support),
	linux-sunxi@lists.linux.dev (open list:ARM/Allwinner sunXi SoC
	support), linux-kernel@vger.kernel.org (open list),
	linux-arm-msm@vger.kernel.org (open list:ARM/QUALCOMM MAILING
	LIST)
Cc: imx@lists.linux.dev, vkoul@kernel.org
Subject: [PATCH] net: dma: use dmaengine_desc_set_callback()
Date: Mon,  2 Nov 2026 14:19:16 -0500	[thread overview]
Message-ID: <20261102191922.4044912-1-Frank.Li@oss.nxp.com> (raw)

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 net 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/net/ethernet/allwinner/sun4i-emac.c       |  3 +--
 drivers/net/ethernet/micrel/ks8842.c              |  6 ++----
 drivers/net/ethernet/xilinx/xilinx_axienet_main.c |  6 ++----
 drivers/net/wwan/qcom_bam_dmux.c                  | 10 ++++------
 4 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 09b2abdfc9e84..d7ee42b2c1976 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -303,8 +303,7 @@ static int emac_dma_inblk_32bit(struct emac_board_info *db,
 		goto prepare_err;
 	}
 
-	desc->callback_param = req;
-	desc->callback = emac_dma_done_callback;
+	dmaengine_desc_set_callback(desc, emac_dma_done_callback, NULL, req);
 
 	cookie = dmaengine_submit(desc);
 	ret = dma_submit_error(cookie);
diff --git a/drivers/net/ethernet/micrel/ks8842.c b/drivers/net/ethernet/micrel/ks8842.c
index f0d6bfc6025ca..c68abd4643e72 100644
--- a/drivers/net/ethernet/micrel/ks8842.c
+++ b/drivers/net/ethernet/micrel/ks8842.c
@@ -453,8 +453,7 @@ static int ks8842_tx_frame_dma(struct sk_buff *skb, struct net_device *netdev)
 	if (!ctl->adesc)
 		return NETDEV_TX_BUSY;
 
-	ctl->adesc->callback_param = netdev;
-	ctl->adesc->callback = ks8842_dma_tx_cb;
+	dmaengine_desc_set_callback(ctl->adesc, ks8842_dma_tx_cb, NULL, netdev);
 	dmaengine_submit(ctl->adesc);
 
 	netdev->stats.tx_bytes += skb->len;
@@ -567,8 +566,7 @@ static int __ks8842_start_new_rx_dma(struct net_device *netdev)
 			goto out;
 		}
 
-		ctl->adesc->callback_param = netdev;
-		ctl->adesc->callback = ks8842_dma_rx_cb;
+		dmaengine_desc_set_callback(ctl->adesc, ks8842_dma_rx_cb, NULL, netdev);
 		dmaengine_submit(ctl->adesc);
 	} else {
 		err = -ENOMEM;
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 8a50cad1c104f..7e83c4b5f1931 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1014,8 +1014,7 @@ axienet_start_xmit_dmaengine(struct sk_buff *skb, struct net_device *ndev)
 
 	skbuf_dma->skb = skb;
 	skbuf_dma->sg_len = sg_len;
-	dma_tx_desc->callback_param = lp;
-	dma_tx_desc->callback_result = axienet_dma_tx_cb;
+	dmaengine_desc_set_callback(dma_tx_desc, NULL, axienet_dma_tx_cb, lp);
 	/* Claim the ring slot only after the steps above that can fail.  The
 	 * completion callback can't run before dmaengine_submit().
 	 */
@@ -1565,8 +1564,7 @@ static void axienet_rx_submit_desc(struct net_device *ndev)
 	skbuf_dma->skb = skb;
 	skbuf_dma->dma_address = sg_dma_address(skbuf_dma->sgl);
 	skbuf_dma->desc = dma_rx_desc;
-	dma_rx_desc->callback_param = lp;
-	dma_rx_desc->callback_result = axienet_dma_rx_cb;
+	dmaengine_desc_set_callback(dma_rx_desc, NULL, axienet_dma_rx_cb, lp);
 	lp->rx_ring_head++;
 	dmaengine_submit(dma_rx_desc);
 
diff --git a/drivers/net/wwan/qcom_bam_dmux.c b/drivers/net/wwan/qcom_bam_dmux.c
index cc6ace8d64371..1479f8362e04e 100644
--- a/drivers/net/wwan/qcom_bam_dmux.c
+++ b/drivers/net/wwan/qcom_bam_dmux.c
@@ -195,9 +195,8 @@ static bool bam_dmux_skb_dma_submit_tx(struct bam_dmux_skb_dma *skb_dma)
 		return false;
 	}
 
-	desc->callback = bam_dmux_tx_callback;
-	desc->callback_param = skb_dma;
-	desc->cookie = dmaengine_submit(desc);
+	dmaengine_desc_set_callback(desc, bam_dmux_tx_callback, NULL, skb_dma);
+	dmaengine_submit(desc);
 	return true;
 }
 
@@ -477,9 +476,8 @@ static bool bam_dmux_skb_dma_submit_rx(struct bam_dmux_skb_dma *skb_dma)
 		return false;
 	}
 
-	desc->callback = bam_dmux_rx_callback;
-	desc->callback_param = skb_dma;
-	desc->cookie = dmaengine_submit(desc);
+	dmaengine_desc_set_callback(desc, bam_dmux_rx_callback, NULL, skb_dma);
+	dmaengine_submit(desc);
 	return true;
 }
 
-- 
2.43.0


             reply	other threads:[~2026-11-02 19:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-02 19:19 Frank.Li [this message]
2026-11-02 23:28 ` Joe Damato
2026-11-03  8:55 ` Loic Poulain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261102191922.4044912-1-Frank.Li@oss.nxp.com \
    --to=frank.li@oss.nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=andre.przywara@arm.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=jernej.skrabec@gmail.com \
    --cc=joe@dama.to \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=liyouhong@kylinos.cn \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=phucduc.bui@gmail.com \
    --cc=radhey.shyam.pandey@amd.com \
    --cc=ryazanov.s.a@gmail.com \
    --cc=samuel@sholland.org \
    --cc=stephan@gerhold.net \
    --cc=vkoul@kernel.org \
    --cc=wens@kernel.org \
    --cc=yiconghui@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®