Netdev List
 help / color / mirror / Atom feed
From: Ioana Ciornei <ciorneiioana@gmail.com>
To: davem@davemloft.net, kuba@kernel.org, netdev@vger.kernel.org
Cc: Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: [PATCH net-next 2/2] dpaa2-eth: name the debugfs directory after the DPNI object
Date: Fri, 21 May 2021 16:25:30 +0300	[thread overview]
Message-ID: <20210521132530.2784829-3-ciorneiioana@gmail.com> (raw)
In-Reply-To: <20210521132530.2784829-1-ciorneiioana@gmail.com>

From: Ioana Ciornei <ioana.ciornei@nxp.com>

Name the debugfs directory after the DPNI object instead of the netdev
name since this can be changed after probe by udev rules.

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
index b87db0846e10..8356af4631fd 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c
@@ -121,10 +121,14 @@ DEFINE_SHOW_ATTRIBUTE(dpaa2_dbg_ch);
 
 void dpaa2_dbg_add(struct dpaa2_eth_priv *priv)
 {
+	struct fsl_mc_device *dpni_dev;
 	struct dentry *dir;
+	char name[10];
 
 	/* Create a directory for the interface */
-	dir = debugfs_create_dir(priv->net_dev->name, dpaa2_dbg_root);
+	dpni_dev = to_fsl_mc_device(priv->net_dev->dev.parent);
+	snprintf(name, 10, "dpni.%d", dpni_dev->obj_desc.id);
+	dir = debugfs_create_dir(name, dpaa2_dbg_root);
 	priv->dbg.dir = dir;
 
 	/* per-cpu stats file */
-- 
2.31.1


  parent reply	other threads:[~2021-05-21 13:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 13:25 [PATCH net-next 0/2] dpaa2-eth: setup the of_node Ioana Ciornei
2021-05-21 13:25 ` [PATCH net-next 1/2] dpaa2-eth: setup the of_node field of the device Ioana Ciornei
2021-05-21 14:22   ` Vladimir Oltean
2021-05-21 13:25 ` Ioana Ciornei [this message]
2021-05-21 14:24   ` [PATCH net-next 2/2] dpaa2-eth: name the debugfs directory after the DPNI object Vladimir Oltean
2021-05-21 21:10 ` [PATCH net-next 0/2] dpaa2-eth: setup the of_node patchwork-bot+netdevbpf

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=20210521132530.2784829-3-ciorneiioana@gmail.com \
    --to=ciorneiioana@gmail.com \
    --cc=davem@davemloft.net \
    --cc=ioana.ciornei@nxp.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /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