[patch 6/7] USB: usbmon: use the new usb debugfs directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



All usb debugfs files should be behind the usb directory, not at the
root of debugfs.  Unfortunately, I think there's some scripts that
expect usbmon to be at the root of debugfs.  So we create a symlink to
keep them happy.

Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

---
 drivers/usb/mon/mon_text.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/usb/mon/mon_text.c
+++ b/drivers/usb/mon/mon_text.c
@@ -86,6 +86,7 @@ struct mon_reader_text {
 };
 
 static struct dentry *mon_dir;		/* Usually /sys/kernel/debug/usbmon */
+static struct dentry *mon_dir_symlink;	/* /sys/kernel/debug/usb/usbmon link */
 
 static void mon_text_ctor(void *);
 
@@ -733,7 +734,7 @@ int __init mon_text_init(void)
 {
 	struct dentry *mondir;
 
-	mondir = debugfs_create_dir("usbmon", NULL);
+	mondir = debugfs_create_dir("usbmon", usb_debug_root);
 	if (IS_ERR(mondir)) {
 		printk(KERN_NOTICE TAG ": debugfs is not available\n");
 		return -ENODEV;
@@ -742,11 +743,13 @@ int __init mon_text_init(void)
 		printk(KERN_NOTICE TAG ": unable to create usbmon directory\n");
 		return -ENODEV;
 	}
+	mon_dir_symlink = debugfs_create_symlink("usbmon", NULL, "usb/usbmon");
 	mon_dir = mondir;
 	return 0;
 }
 
 void mon_text_exit(void)
 {
+	debugfs_remove(mon_dir_symlink);
 	debugfs_remove(mon_dir);
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux