Revert "[PATCH] USB: convert usb class devices to real devices"

This reverts bd00949647ddcea47ce4ea8bb2cfcfc98ebf9f2a commit because it
required a newer version of udev to work properly than what is currently
documented in Documentation/Changes.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+9 -9
+7 -6
drivers/usb/core/file.c
··· 194 ++temp; 195 else 196 temp = name; 197 - intf->usb_dev = device_create(usb_class->class, &intf->dev, 198 - MKDEV(USB_MAJOR, minor), "%s", temp); 199 - if (IS_ERR(intf->usb_dev)) { 200 spin_lock (&minor_lock); 201 usb_minors[intf->minor] = NULL; 202 spin_unlock (&minor_lock); 203 - retval = PTR_ERR(intf->usb_dev); 204 } 205 exit: 206 return retval; ··· 242 spin_unlock (&minor_lock); 243 244 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); 245 - device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); 246 - intf->usb_dev = NULL; 247 intf->minor = -1; 248 destroy_usb_class(); 249 }
··· 194 ++temp; 195 else 196 temp = name; 197 + intf->class_dev = class_device_create(usb_class->class, NULL, 198 + MKDEV(USB_MAJOR, minor), 199 + &intf->dev, "%s", temp); 200 + if (IS_ERR(intf->class_dev)) { 201 spin_lock (&minor_lock); 202 usb_minors[intf->minor] = NULL; 203 spin_unlock (&minor_lock); 204 + retval = PTR_ERR(intf->class_dev); 205 } 206 exit: 207 return retval; ··· 241 spin_unlock (&minor_lock); 242 243 snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base); 244 + class_device_destroy(usb_class->class, MKDEV(USB_MAJOR, intf->minor)); 245 + intf->class_dev = NULL; 246 intf->minor = -1; 247 destroy_usb_class(); 248 }
+2 -3
include/linux/usb.h
··· 103 * @condition: binding state of the interface: not bound, binding 104 * (in probe()), bound to a driver, or unbinding (in disconnect()) 105 * @dev: driver model's view of this device 106 - * @usb_dev: if an interface is bound to the USB major, this will point 107 - * to the sysfs representation for that device. 108 * 109 * USB device drivers attach to interfaces on a physical device. Each 110 * interface encapsulates a single high level function, such as feeding ··· 143 * bound to */ 144 enum usb_interface_condition condition; /* state of binding */ 145 struct device dev; /* interface specific device info */ 146 - struct device *usb_dev; /* pointer to the usb class's device, if any */ 147 }; 148 #define to_usb_interface(d) container_of(d, struct usb_interface, dev) 149 #define interface_to_usbdev(intf) \
··· 103 * @condition: binding state of the interface: not bound, binding 104 * (in probe()), bound to a driver, or unbinding (in disconnect()) 105 * @dev: driver model's view of this device 106 + * @class_dev: driver model's class view of this device. 107 * 108 * USB device drivers attach to interfaces on a physical device. Each 109 * interface encapsulates a single high level function, such as feeding ··· 144 * bound to */ 145 enum usb_interface_condition condition; /* state of binding */ 146 struct device dev; /* interface specific device info */ 147 + struct class_device *class_dev; 148 }; 149 #define to_usb_interface(d) container_of(d, struct usb_interface, dev) 150 #define interface_to_usbdev(intf) \