diff options
author | Madalin Bucur <madalin.bucur@freescale.com> | 2015-03-12 14:59:50 (GMT) |
---|---|---|
committer | Madalin-Cristian Bucur <madalin.bucur@freescale.com> | 2015-03-12 15:38:26 (GMT) |
commit | 9afc74818962f09450b5008650cce4ac19faacf9 (patch) | |
tree | b43e42b8d2e2a1114936102969e210d9f677e7b3 /drivers/net/ethernet | |
parent | e4497441f087f267d906a4254e0a544722e1a71d (diff) | |
download | linux-fsl-qoriq-9afc74818962f09450b5008650cce4ac19faacf9.tar.xz |
dpaa_eth: fix udev interference
udev renames each new interface as soon as it's created so all
interfaces are named eth1, resulting in name conflicts for the
debugfs files created based on device name. This patch fixes
that problem by imposing eth1..N naming for the debugfs entries.
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Change-Id: I105c0b1bf0cc604ae6c3f18eb74769b05e0367a2
Reviewed-on: http://git.am.freescale.net:8181/32669
Reviewed-by: Marian Cristian Rotariu <marian.rotariu@freescale.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_debugfs.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_debugfs.c b/drivers/net/ethernet/freescale/dpa/dpaa_debugfs.c index ce63e187..59c7338 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_debugfs.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_debugfs.c @@ -307,6 +307,8 @@ static int __cold dpa_debugfs_open(struct inode *inode, struct file *file) int dpa_netdev_debugfs_create(struct net_device *net_dev) { struct dpa_priv_s *priv = netdev_priv(net_dev); + static int cnt; + char debugfs_file_name[100]; #ifdef CONFIG_FSL_DPAA_DBG_LOOP char loop_file_name[100]; #endif @@ -318,7 +320,8 @@ int dpa_netdev_debugfs_create(struct net_device *net_dev) return -ENOMEM; } - priv->debugfs_file = debugfs_create_file(net_dev->name, + snprintf(debugfs_file_name, 100, "eth%d", ++cnt); + priv->debugfs_file = debugfs_create_file(debugfs_file_name, S_IRUGO, dpa_debugfs_root, net_dev, @@ -326,13 +329,13 @@ int dpa_netdev_debugfs_create(struct net_device *net_dev) if (unlikely(priv->debugfs_file == NULL)) { netdev_err(net_dev, "debugfs_create_file(%s/%s)", dpa_debugfs_root->d_iname, - net_dev->name); + debugfs_file_name); return -ENOMEM; } #ifdef CONFIG_FSL_DPAA_DBG_LOOP - sprintf(loop_file_name, "%s_loop", net_dev->name); + sprintf(loop_file_name, "eth%d_loop", cnt); priv->debugfs_loop_file = debugfs_create_file(loop_file_name, S_IRUGO, dpa_debugfs_root, |