dpaa2-eth: name the debugfs directory after the DPNI object
authorIoana Ciornei <ioana.ciornei@nxp.com>
Fri, 21 May 2021 13:25:30 +0000 (16:25 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 May 2021 21:05:04 +0000 (14:05 -0700)
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>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth-debugfs.c

index b87db08..8356af4 100644 (file)
@@ -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 */