aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/core/Kconfig23
-rw-r--r--drivers/usb/core/devio.c49
-rw-r--r--include/linux/usb.h3
3 files changed, 0 insertions, 75 deletions
diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
index 751031e8d8d2..fe46fc09defc 100644
--- a/drivers/usb/core/Kconfig
+++ b/drivers/usb/core/Kconfig
@@ -27,29 +27,6 @@ config USB_ANNOUNCE_NEW_DEVICES
27comment "Miscellaneous USB options" 27comment "Miscellaneous USB options"
28 depends on USB 28 depends on USB
29 29
30config USB_DEVICE_CLASS
31 bool "USB device class-devices (DEPRECATED)"
32 depends on USB
33 default y
34 ---help---
35 Userspace access to USB devices is granted by device-nodes exported
36 directly from the usbdev in sysfs. Old versions of the driver
37 core and udev needed additional class devices to export device nodes.
38
39 These additional devices are difficult to handle in userspace, if
40 information about USB interfaces must be available. One device
41 contains the device node, the other device contains the interface
42 data. Both devices are at the same level in sysfs (siblings) and one
43 can't access the other. The device node created directly by the
44 usb device is the parent device of the interface and therefore
45 easily accessible from the interface event.
46
47 This option provides backward compatibility for libusb device
48 nodes (lsusb) when usbfs is not used, and the following udev rule
49 doesn't exist:
50 SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
51 NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
52
53config USB_DYNAMIC_MINORS 30config USB_DYNAMIC_MINORS
54 bool "Dynamic USB minor allocation" 31 bool "Dynamic USB minor allocation"
55 depends on USB 32 depends on USB
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 90db6e2a573f..c4a1af8a954b 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -2051,44 +2051,13 @@ static void usbdev_remove(struct usb_device *udev)
2051 } 2051 }
2052} 2052}
2053 2053
2054#ifdef CONFIG_USB_DEVICE_CLASS
2055static struct class *usb_classdev_class;
2056
2057static int usb_classdev_add(struct usb_device *dev)
2058{
2059 struct device *cldev;
2060
2061 cldev = device_create(usb_classdev_class, &dev->dev, dev->dev.devt,
2062 NULL, "usbdev%d.%d", dev->bus->busnum,
2063 dev->devnum);
2064 if (IS_ERR(cldev))
2065 return PTR_ERR(cldev);
2066 dev->usb_classdev = cldev;
2067 return 0;
2068}
2069
2070static void usb_classdev_remove(struct usb_device *dev)
2071{
2072 if (dev->usb_classdev)
2073 device_unregister(dev->usb_classdev);
2074}
2075
2076#else
2077#define usb_classdev_add(dev) 0
2078#define usb_classdev_remove(dev) do {} while (0)
2079
2080#endif
2081
2082static int usbdev_notify(struct notifier_block *self, 2054static int usbdev_notify(struct notifier_block *self,
2083 unsigned long action, void *dev) 2055 unsigned long action, void *dev)
2084{ 2056{
2085 switch (action) { 2057 switch (action) {
2086 case USB_DEVICE_ADD: 2058 case USB_DEVICE_ADD:
2087 if (usb_classdev_add(dev))
2088 return NOTIFY_BAD;
2089 break; 2059 break;
2090 case USB_DEVICE_REMOVE: 2060 case USB_DEVICE_REMOVE:
2091 usb_classdev_remove(dev);
2092 usbdev_remove(dev); 2061 usbdev_remove(dev);
2093 break; 2062 break;
2094 } 2063 }
@@ -2118,21 +2087,6 @@ int __init usb_devio_init(void)
2118 USB_DEVICE_MAJOR); 2087 USB_DEVICE_MAJOR);
2119 goto error_cdev; 2088 goto error_cdev;
2120 } 2089 }
2121#ifdef CONFIG_USB_DEVICE_CLASS
2122 usb_classdev_class = class_create(THIS_MODULE, "usb_device");
2123 if (IS_ERR(usb_classdev_class)) {
2124 printk(KERN_ERR "Unable to register usb_device class\n");
2125 retval = PTR_ERR(usb_classdev_class);
2126 cdev_del(&usb_device_cdev);
2127 usb_classdev_class = NULL;
2128 goto out;
2129 }
2130 /* devices of this class shadow the major:minor of their parent
2131 * device, so clear ->dev_kobj to prevent adding duplicate entries
2132 * to /sys/dev
2133 */
2134 usb_classdev_class->dev_kobj = NULL;
2135#endif
2136 usb_register_notify(&usbdev_nb); 2090 usb_register_notify(&usbdev_nb);
2137out: 2091out:
2138 return retval; 2092 return retval;
@@ -2145,9 +2099,6 @@ error_cdev:
2145void usb_devio_cleanup(void) 2099void usb_devio_cleanup(void)
2146{ 2100{
2147 usb_unregister_notify(&usbdev_nb); 2101 usb_unregister_notify(&usbdev_nb);
2148#ifdef CONFIG_USB_DEVICE_CLASS
2149 class_destroy(usb_classdev_class);
2150#endif
2151 cdev_del(&usb_device_cdev); 2102 cdev_del(&usb_device_cdev);
2152 unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX); 2103 unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX);
2153} 2104}
diff --git a/include/linux/usb.h b/include/linux/usb.h
index a63c5baa9f65..8fa9a93a4ec4 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -489,9 +489,6 @@ struct usb_device {
489 char *serial; 489 char *serial;
490 490
491 struct list_head filelist; 491 struct list_head filelist;
492#ifdef CONFIG_USB_DEVICE_CLASS
493 struct device *usb_classdev;
494#endif
495 492
496 int maxchild; 493 int maxchild;
497 struct usb_device **children; 494 struct usb_device **children;