DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: hemant.agrawal@nxp.com, maxime@leroys.fr,
	Sachin Saxena <sachin.saxena@nxp.com>,
	Gagandeep Singh <g.singh@nxp.com>
Subject: [PATCH 2/5] dma/dpaa2: remove DMA device in bus device
Date: Sat,  8 Nov 2025 16:32:03 +0100	[thread overview]
Message-ID: <20251108153207.1512863-3-david.marchand@redhat.com> (raw)
In-Reply-To: <20251108153207.1512863-1-david.marchand@redhat.com>

A driver .dev_close op is automatically called when releasing a dma
device.
Move device specific unitialisation in this driver .dev_close op.

This leaves no user of the dmadev field in the fslmc device object.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 drivers/bus/fslmc/bus_fslmc_driver.h | 1 -
 drivers/dma/dpaa2/dpaa2_qdma.c       | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/fslmc/bus_fslmc_driver.h b/drivers/bus/fslmc/bus_fslmc_driver.h
index 45c7a519f9..efa88754a7 100644
--- a/drivers/bus/fslmc/bus_fslmc_driver.h
+++ b/drivers/bus/fslmc/bus_fslmc_driver.h
@@ -99,7 +99,6 @@ struct rte_dpaa2_device {
 	struct rte_device device;           /**< Inherit core device */
 	union {
 		struct rte_eth_dev *eth_dev;        /**< ethernet device */
-		struct rte_dma_dev *dmadev;          /**< DMA Device */
 		struct rte_rawdev *rawdev;          /**< Raw Device */
 	};
 	enum rte_dpaa2_dev_type dev_type;   /**< Device Type */
diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c
index 4be43d6bd9..beca464c72 100644
--- a/drivers/dma/dpaa2/dpaa2_qdma.c
+++ b/drivers/dma/dpaa2/dpaa2_qdma.c
@@ -1455,6 +1455,9 @@ dpaa2_qdma_stop(struct rte_dma_dev *dev)
 	return 0;
 }
 
+static int
+dpaa2_dpdmai_dev_uninit(struct rte_dma_dev *dev);
+
 static int
 dpaa2_qdma_close(struct rte_dma_dev *dev)
 {
@@ -1505,6 +1508,8 @@ dpaa2_qdma_close(struct rte_dma_dev *dev)
 	/* Reset QDMA device structure */
 	qdma_dev->num_vqs = 0;
 
+	dpaa2_dpdmai_dev_uninit(dev);
+
 	return 0;
 }
 
@@ -1703,7 +1708,6 @@ dpaa2_qdma_probe(struct rte_dpaa2_driver *dpaa2_drv,
 		return -EINVAL;
 	}
 
-	dpaa2_dev->dmadev = dmadev;
 	dmadev->dev_ops = &dpaa2_qdma_ops;
 	dmadev->device = &dpaa2_dev->device;
 	dmadev->fp_obj->dev_private = dmadev->data->dev_private;
@@ -1727,13 +1731,10 @@ dpaa2_qdma_probe(struct rte_dpaa2_driver *dpaa2_drv,
 static int
 dpaa2_qdma_remove(struct rte_dpaa2_device *dpaa2_dev)
 {
-	struct rte_dma_dev *dmadev = dpaa2_dev->dmadev;
 	int ret;
 
 	DPAA2_QDMA_FUNC_TRACE();
 
-	dpaa2_dpdmai_dev_uninit(dmadev);
-
 	ret = rte_dma_pmd_release(dpaa2_dev->device.name);
 	if (ret)
 		DPAA2_QDMA_ERR("Device cleanup failed");
-- 
2.51.0


  parent reply	other threads:[~2025-11-08 15:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-08 15:32 [PATCH 0/5] Cleanup rte_dpaa2_device David Marchand
2025-11-08 15:32 ` [PATCH 1/5] crypto/dpaa2_sec: remove crypto device in bus device David Marchand
2025-11-08 15:32 ` David Marchand [this message]
2025-11-08 15:32 ` [PATCH 3/5] net/dpaa2: remove dead code in loopback mode David Marchand
2025-11-08 15:32 ` [PATCH 4/5] net/dpaa2: remove ethdev device in bus device David Marchand
2025-11-08 15:32 ` [PATCH 5/5] bus/fslmc: remove raw " David Marchand

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=20251108153207.1512863-3-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=g.singh@nxp.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=maxime@leroys.fr \
    --cc=sachin.saxena@nxp.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;
as well as URLs for NNTP newsgroup(s).