aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers/net
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2013-12-17 15:12:50 +0000
committerGabor Juhos <juhosg@openwrt.org>2013-12-17 15:12:50 +0000
commitbfbdffe87647a3d3bc49864f4a126c88a5b72ba3 (patch)
tree2b5ea917e70c1ba02a66f511b0fbe7ef24b81275 /target/linux/ar71xx/files/drivers/net
parentff7ac2a2ce8cb8146f433b90cb758400eddedb71 (diff)
downloadmaster-187ad058-bfbdffe87647a3d3bc49864f4a126c88a5b72ba3.tar.gz
master-187ad058-bfbdffe87647a3d3bc49864f4a126c88a5b72ba3.tar.bz2
master-187ad058-bfbdffe87647a3d3bc49864f4a126c88a5b72ba3.zip
ag71xx: ag71xx: use device name for debugfs entry
The ag71xx debugfs code uses the network device name for the device specific debugfs directory. Since r38689 'ar71xx: ag71xx: fix a race involving netdev registration' the debugfs initialization happens before the ethernet device gets registered and the network device name contains 'eth%d' at this point. If the board setup code registers multiple ag71xx devices, the debugfs code tries to create the device specific dir with the same name which causes an error like this: eth0: Atheros AG71xx at 0xba000000, irq 5, mode:GMII ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY] ag71xx: probe of ag71xx.0 failed with error -12 Use the device name for the debugfs directory to avoid the collisions. Also add an error message and change the return code if the debugfs_create_dir call fails. Reported-by: Ronald Wahl <ronald.wahl@raritan.com> Signed-off-by: Gabor Juhos <juhosg@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39115 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/drivers/net')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_debugfs.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_debugfs.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_debugfs.c
index 65f2be198f..757a572b00 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_debugfs.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_debugfs.c
@@ -244,10 +244,14 @@ void ag71xx_debugfs_exit(struct ag71xx *ag)
int ag71xx_debugfs_init(struct ag71xx *ag)
{
- ag->debug.debugfs_dir = debugfs_create_dir(ag->dev->name,
+ struct device *dev = &ag->pdev->dev;
+
+ ag->debug.debugfs_dir = debugfs_create_dir(dev_name(dev),
ag71xx_debugfs_root);
- if (!ag->debug.debugfs_dir)
- return -ENOMEM;
+ if (!ag->debug.debugfs_dir) {
+ dev_err(dev, "unable to create debugfs directory\n");
+ return -ENOENT;
+ }
debugfs_create_file("int_stats", S_IRUGO, ag->debug.debugfs_dir,
ag, &ag71xx_fops_int_stats);