diff options
-rw-r--r-- | drivers/usb/core/Makefile | 4 | ||||
-rw-r--r-- | drivers/usb/core/usb.c | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile index b6078706fb93..ec16e6029905 100644 --- a/drivers/usb/core/Makefile +++ b/drivers/usb/core/Makefile | |||
@@ -4,14 +4,14 @@ | |||
4 | 4 | ||
5 | usbcore-objs := usb.o hub.o hcd.o urb.o message.o driver.o \ | 5 | usbcore-objs := usb.o hub.o hcd.o urb.o message.o driver.o \ |
6 | config.o file.o buffer.o sysfs.o endpoint.o \ | 6 | config.o file.o buffer.o sysfs.o endpoint.o \ |
7 | devio.o notify.o generic.o quirks.o | 7 | devio.o notify.o generic.o quirks.o devices.o |
8 | 8 | ||
9 | ifeq ($(CONFIG_PCI),y) | 9 | ifeq ($(CONFIG_PCI),y) |
10 | usbcore-objs += hcd-pci.o | 10 | usbcore-objs += hcd-pci.o |
11 | endif | 11 | endif |
12 | 12 | ||
13 | ifeq ($(CONFIG_USB_DEVICEFS),y) | 13 | ifeq ($(CONFIG_USB_DEVICEFS),y) |
14 | usbcore-objs += inode.o devices.o | 14 | usbcore-objs += inode.o |
15 | endif | 15 | endif |
16 | 16 | ||
17 | obj-$(CONFIG_USB) += usbcore.o | 17 | obj-$(CONFIG_USB) += usbcore.o |
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 5f6873f5f268..c71590666ade 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -1005,16 +1005,29 @@ static struct notifier_block usb_bus_nb = { | |||
1005 | struct dentry *usb_debug_root; | 1005 | struct dentry *usb_debug_root; |
1006 | EXPORT_SYMBOL_GPL(usb_debug_root); | 1006 | EXPORT_SYMBOL_GPL(usb_debug_root); |
1007 | 1007 | ||
1008 | struct dentry *usb_debug_devices; | ||
1009 | |||
1008 | static int usb_debugfs_init(void) | 1010 | static int usb_debugfs_init(void) |
1009 | { | 1011 | { |
1010 | usb_debug_root = debugfs_create_dir("usb", NULL); | 1012 | usb_debug_root = debugfs_create_dir("usb", NULL); |
1011 | if (!usb_debug_root) | 1013 | if (!usb_debug_root) |
1012 | return -ENOENT; | 1014 | return -ENOENT; |
1015 | |||
1016 | usb_debug_devices = debugfs_create_file("devices", 0444, | ||
1017 | usb_debug_root, NULL, | ||
1018 | &usbfs_devices_fops); | ||
1019 | if (!usb_debug_devices) { | ||
1020 | debugfs_remove(usb_debug_root); | ||
1021 | usb_debug_root = NULL; | ||
1022 | return -ENOENT; | ||
1023 | } | ||
1024 | |||
1013 | return 0; | 1025 | return 0; |
1014 | } | 1026 | } |
1015 | 1027 | ||
1016 | static void usb_debugfs_cleanup(void) | 1028 | static void usb_debugfs_cleanup(void) |
1017 | { | 1029 | { |
1030 | debugfs_remove(usb_debug_devices); | ||
1018 | debugfs_remove(usb_debug_root); | 1031 | debugfs_remove(usb_debug_root); |
1019 | } | 1032 | } |
1020 | 1033 | ||