Skip to contentSkip to conversation

6lowpan: fix debugfs interface entry name

PATCH In review Alexander Aring 3 participants 3 messages Dec 15, 2015 – Dec 20, 2015

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 6lowpan: fix debugfs interface entry name

This patches moves the debugfs interface related register after netdevice register. The function lowpan_dev_debugfs_init will use "dev->name" which can be before register_netdevice a format string. The function register_netdevice will evaluate the format string if necessary and replace "dev->name" to the real interface name.

---
 net/6lowpan/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/6lowpan/core.c +3 -3
index c7f06f5..faf65ba 100644
@@ -29,13 +29,13 @@ int lowpan_register_netdevice(struct net_device *dev,
 
 	lowpan_priv(dev)->lltype = lltype;
 
-	ret = lowpan_dev_debugfs_init(dev);
+	ret = register_netdevice(dev);
 	if (ret < 0)
 		return ret;
 
-	ret = register_netdevice(dev);
+	ret = lowpan_dev_debugfs_init(dev);
 	if (ret < 0)
-		lowpan_dev_debugfs_exit(dev);
+		unregister_netdevice(dev);
 
 	return ret;
 }
Signature · 1 line
2.6.1
Acked-by on v1 1/1
#1 lore raw

Hi Alex,

Quoted 41 lines

-----Original Message-----
From: Alexander Aring [mailto:[email protected]]
Sent: Tuesday, December 15, 2015 12:26
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; Duda, Lukasz; Alexander Aring
Subject: [PATCH bluetooth-next] 6lowpan: fix debugfs interface entry name

This patches moves the debugfs interface related register after netdevice register. The function lowpan_dev_debugfs_init will use "dev->name" which can be before register_netdevice a format string.
The function register_netdevice will evaluate the format string if necessary and replace "dev->name" to the real interface name.

---
 net/6lowpan/core.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/6lowpan/core.c index c7f06f5..faf65ba renamed from net/6lowpan/core.c +0 -0

100644

net/6lowpan/core.c +3 -3
@@ -29,13 +29,13 @@ int lowpan_register_netdevice(struct net_device
 *dev,
 
 	lowpan_priv(dev)->lltype = lltype;
 
-	ret = lowpan_dev_debugfs_init(dev);
+	ret = register_netdevice(dev);
 	if (ret < 0)
 		return ret;
 
-	ret = register_netdevice(dev);
+	ret = lowpan_dev_debugfs_init(dev);
 	if (ret < 0)
-		lowpan_dev_debugfs_exit(dev);
+		unregister_netdevice(dev);
 
 	return ret;
Quoted 3 lines

}
--
2.6.1

Thanks, after this change I do have correct interface name under /sys/kernel/debug/6lowpan for Bluetooth Low Energy (bt0).

Best regards,
Łukasz

maintainer
#2 lore raw
In reply to Alexander Aring

Hi Alex,

Quoted 11 lines

This patches moves the debugfs interface related register after netdevice register. The function lowpan_dev_debugfs_init will use "dev->name" which can be before register_netdevice a format string. The function register_netdevice will evaluate the format string if necessary and replace "dev->name" to the real interface name.

---
net/6lowpan/core.c | 6 +++---

1 file changed, 3 insertions(+), 3 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel