aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/devio.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-25 18:26:54 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-29 22:29:57 -0400
commit007bab91324e6337bb150ffc17b20cf829686370 (patch)
tree6aed165e4fb5d128720849abf7549e346e36158c /drivers/usb/core/devio.c
parentfb28d58b72aa9215b26f1d5478462af394a4d253 (diff)
USB: remove CONFIG_USB_DEVICE_CLASS
This option has been deprecated for many years now, and no userspace tools use it anymore, so it should be safe to finally remove it. Reported-by: Kay Sievers <kay@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r--drivers/usb/core/devio.c49
1 files changed, 0 insertions, 49 deletions
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}