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>
This commit is contained in:
		
							parent
							
								
									fb28d58b72
								
							
						
					
					
						commit
						007bab9132
					
				| @ -27,29 +27,6 @@ config USB_ANNOUNCE_NEW_DEVICES | |||||||
| comment "Miscellaneous USB options" | comment "Miscellaneous USB options" | ||||||
| 	depends on USB | 	depends on USB | ||||||
| 
 | 
 | ||||||
| config USB_DEVICE_CLASS |  | ||||||
| 	bool "USB device class-devices (DEPRECATED)" |  | ||||||
| 	depends on USB |  | ||||||
| 	default y |  | ||||||
| 	---help--- |  | ||||||
| 	  Userspace access to USB devices is granted by device-nodes exported |  | ||||||
| 	  directly from the usbdev in sysfs. Old versions of the driver |  | ||||||
| 	  core and udev needed additional class devices to export device nodes. |  | ||||||
| 
 |  | ||||||
| 	  These additional devices are difficult to handle in userspace, if |  | ||||||
| 	  information about USB interfaces must be available. One device |  | ||||||
| 	  contains the device node, the other device contains the interface |  | ||||||
| 	  data. Both devices are at the same level in sysfs (siblings) and one |  | ||||||
| 	  can't access the other. The device node created directly by the |  | ||||||
| 	  usb device is the parent device of the interface and therefore |  | ||||||
| 	  easily accessible from the interface event. |  | ||||||
| 
 |  | ||||||
| 	  This option provides backward compatibility for libusb device |  | ||||||
| 	  nodes (lsusb) when usbfs is not used, and the following udev rule |  | ||||||
| 	  doesn't exist: |  | ||||||
| 	    SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \ |  | ||||||
| 	    NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644" |  | ||||||
| 
 |  | ||||||
| config USB_DYNAMIC_MINORS | config USB_DYNAMIC_MINORS | ||||||
| 	bool "Dynamic USB minor allocation" | 	bool "Dynamic USB minor allocation" | ||||||
| 	depends on USB | 	depends on USB | ||||||
|  | |||||||
| @ -2051,44 +2051,13 @@ static void usbdev_remove(struct usb_device *udev) | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #ifdef CONFIG_USB_DEVICE_CLASS |  | ||||||
| static struct class *usb_classdev_class; |  | ||||||
| 
 |  | ||||||
| static int usb_classdev_add(struct usb_device *dev) |  | ||||||
| { |  | ||||||
| 	struct device *cldev; |  | ||||||
| 
 |  | ||||||
| 	cldev = device_create(usb_classdev_class, &dev->dev, dev->dev.devt, |  | ||||||
| 			      NULL, "usbdev%d.%d", dev->bus->busnum, |  | ||||||
| 			      dev->devnum); |  | ||||||
| 	if (IS_ERR(cldev)) |  | ||||||
| 		return PTR_ERR(cldev); |  | ||||||
| 	dev->usb_classdev = cldev; |  | ||||||
| 	return 0; |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| static void usb_classdev_remove(struct usb_device *dev) |  | ||||||
| { |  | ||||||
| 	if (dev->usb_classdev) |  | ||||||
| 		device_unregister(dev->usb_classdev); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| #else |  | ||||||
| #define usb_classdev_add(dev)		0 |  | ||||||
| #define usb_classdev_remove(dev)	do {} while (0) |  | ||||||
| 
 |  | ||||||
| #endif |  | ||||||
| 
 |  | ||||||
| static int usbdev_notify(struct notifier_block *self, | static int usbdev_notify(struct notifier_block *self, | ||||||
| 			       unsigned long action, void *dev) | 			       unsigned long action, void *dev) | ||||||
| { | { | ||||||
| 	switch (action) { | 	switch (action) { | ||||||
| 	case USB_DEVICE_ADD: | 	case USB_DEVICE_ADD: | ||||||
| 		if (usb_classdev_add(dev)) |  | ||||||
| 			return NOTIFY_BAD; |  | ||||||
| 		break; | 		break; | ||||||
| 	case USB_DEVICE_REMOVE: | 	case USB_DEVICE_REMOVE: | ||||||
| 		usb_classdev_remove(dev); |  | ||||||
| 		usbdev_remove(dev); | 		usbdev_remove(dev); | ||||||
| 		break; | 		break; | ||||||
| 	} | 	} | ||||||
| @ -2118,21 +2087,6 @@ int __init usb_devio_init(void) | |||||||
| 		       USB_DEVICE_MAJOR); | 		       USB_DEVICE_MAJOR); | ||||||
| 		goto error_cdev; | 		goto error_cdev; | ||||||
| 	} | 	} | ||||||
| #ifdef CONFIG_USB_DEVICE_CLASS |  | ||||||
| 	usb_classdev_class = class_create(THIS_MODULE, "usb_device"); |  | ||||||
| 	if (IS_ERR(usb_classdev_class)) { |  | ||||||
| 		printk(KERN_ERR "Unable to register usb_device class\n"); |  | ||||||
| 		retval = PTR_ERR(usb_classdev_class); |  | ||||||
| 		cdev_del(&usb_device_cdev); |  | ||||||
| 		usb_classdev_class = NULL; |  | ||||||
| 		goto out; |  | ||||||
| 	} |  | ||||||
| 	/* devices of this class shadow the major:minor of their parent
 |  | ||||||
| 	 * device, so clear ->dev_kobj to prevent adding duplicate entries |  | ||||||
| 	 * to /sys/dev |  | ||||||
| 	 */ |  | ||||||
| 	usb_classdev_class->dev_kobj = NULL; |  | ||||||
| #endif |  | ||||||
| 	usb_register_notify(&usbdev_nb); | 	usb_register_notify(&usbdev_nb); | ||||||
| out: | out: | ||||||
| 	return retval; | 	return retval; | ||||||
| @ -2145,9 +2099,6 @@ error_cdev: | |||||||
| void usb_devio_cleanup(void) | void usb_devio_cleanup(void) | ||||||
| { | { | ||||||
| 	usb_unregister_notify(&usbdev_nb); | 	usb_unregister_notify(&usbdev_nb); | ||||||
| #ifdef CONFIG_USB_DEVICE_CLASS |  | ||||||
| 	class_destroy(usb_classdev_class); |  | ||||||
| #endif |  | ||||||
| 	cdev_del(&usb_device_cdev); | 	cdev_del(&usb_device_cdev); | ||||||
| 	unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX); | 	unregister_chrdev_region(USB_DEVICE_DEV, USB_DEVICE_MAX); | ||||||
| } | } | ||||||
|  | |||||||
| @ -489,9 +489,6 @@ struct usb_device { | |||||||
| 	char *serial; | 	char *serial; | ||||||
| 
 | 
 | ||||||
| 	struct list_head filelist; | 	struct list_head filelist; | ||||||
| #ifdef CONFIG_USB_DEVICE_CLASS |  | ||||||
| 	struct device *usb_classdev; |  | ||||||
| #endif |  | ||||||
| 
 | 
 | ||||||
| 	int maxchild; | 	int maxchild; | ||||||
| 	struct usb_device **children; | 	struct usb_device **children; | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user