summaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/usb.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2009-04-24 14:56:26 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2009-06-15 21:44:42 -0700
commit00048b8bde5a6cbd9c3a76f272cc9ddb55705e37 (patch)
treefd8acec26630c895b8012e7ed0699274064b1212 /drivers/usb/core/usb.c
parent84fe6e799deaf14e2c7a941e805cd93d83f90927 (diff)
downloadlinux-stable-00048b8bde5a6cbd9c3a76f272cc9ddb55705e37.tar.gz
linux-stable-00048b8bde5a6cbd9c3a76f272cc9ddb55705e37.tar.bz2
linux-stable-00048b8bde5a6cbd9c3a76f272cc9ddb55705e37.zip
USB: add usb debugfs directory
Add a common usb directory in debugfs that the usb subsystem can use. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/core/usb.c')
-rw-r--r--drivers/usb/core/usb.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 7eee400d3e32..5f6873f5f268 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -34,6 +34,7 @@
#include <linux/usb.h>
#include <linux/mutex.h>
#include <linux/workqueue.h>
+#include <linux/debugfs.h>
#include <asm/io.h>
#include <linux/scatterlist.h>
@@ -1001,6 +1002,22 @@ static struct notifier_block usb_bus_nb = {
.notifier_call = usb_bus_notify,
};
+struct dentry *usb_debug_root;
+EXPORT_SYMBOL_GPL(usb_debug_root);
+
+static int usb_debugfs_init(void)
+{
+ usb_debug_root = debugfs_create_dir("usb", NULL);
+ if (!usb_debug_root)
+ return -ENOENT;
+ return 0;
+}
+
+static void usb_debugfs_cleanup(void)
+{
+ debugfs_remove(usb_debug_root);
+}
+
/*
* Init
*/
@@ -1012,6 +1029,10 @@ static int __init usb_init(void)
return 0;
}
+ retval = usb_debugfs_init();
+ if (retval)
+ goto out;
+
retval = ksuspend_usb_init();
if (retval)
goto out;
@@ -1083,6 +1104,7 @@ static void __exit usb_exit(void)
bus_unregister_notifier(&usb_bus_type, &usb_bus_nb);
bus_unregister(&usb_bus_type);
ksuspend_usb_cleanup();
+ usb_debugfs_cleanup();
}
subsys_initcall(usb_init);