Skip to contentSkip to conversation

cfg80211: use debugfs_rename

PATCH New Johannes Berg 1 participant 1 message May 22, 2007 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 cfg80211: use debugfs_rename

Use the new debugfs_rename function in mac80211's debugfs where necessary and fix a bug with renaming.

---
debugfs_rename hasn't actually been merged yet, but I hope it will be merged soon. URL is
http://article.gmane.org/gmane.linux.file-systems/14819

This patch should also apply against net-2.6 (with some fuzz though due to the nl80211 bit)

 net/wireless/core.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
net/wireless/core.c +7 -2
@@ -162,10 +162,15 @@ int cfg80211_dev_rename(struct cfg80211_
 
 	/* this will check for collisions */
 	result = device_rename(&rdev->wiphy.dev, newname);
-	if (!result)
+	if (result)
 		return result;
 
-	/* TODO: do debugfs rename! */
+	if (!debugfs_rename(rdev->wiphy.debugfsdir->d_parent,
+			    rdev->wiphy.debugfsdir,
+			    rdev->wiphy.debugfsdir->d_parent,
+			    newname))
+		printk(KERN_ERR "cfg80211: failed to rename debugfs dir to %s!\n",
+		       newname);
 
 	nl80211_notify_dev_rename(rdev);