aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-06-20 14:03:29 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-20 14:03:29 -0700
commit7a24a1d05e6a8485649db8340eb5bb049e4dde02 (patch)
tree1437a02b0b09bb29a301b7b5a139091de1173a3f /usb
parent2762ec6d5b46de76ca2e4b871bfb5cfcb640904b (diff)
downloadpatches-7a24a1d05e6a8485649db8340eb5bb049e4dde02.tar.gz
add new usb patch
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-class-device-to-device.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/usb/usb-class-device-to-device.patch b/usb/usb-class-device-to-device.patch
new file mode 100644
index 0000000000000..a30eb50dccc77
--- /dev/null
+++ b/usb/usb-class-device-to-device.patch
@@ -0,0 +1,67 @@
+From foo@baz Tue Apr 9 12:12:43 2002
+Date: Tue, 20 Jun 2006 13:09:50 -0700
+To: Greg KH <greg@kroah.com>
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Subject: USB: convert usb class devices to real devices
+
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/file.c | 13 ++++++-------
+ include/linux/usb.h | 5 +++--
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/core/file.c
++++ gregkh-2.6/drivers/usb/core/file.c
+@@ -158,14 +158,13 @@ int usb_register_dev(struct usb_interfac
+ ++temp;
+ else
+ temp = name;
+- intf->class_dev = class_device_create(usb_class, NULL,
+- MKDEV(USB_MAJOR, minor),
+- &intf->dev, "%s", temp);
+- if (IS_ERR(intf->class_dev)) {
++ intf->usb_dev = device_create(usb_class, &intf->dev,
++ MKDEV(USB_MAJOR, minor), "%s", temp);
++ if (IS_ERR(intf->usb_dev)) {
+ spin_lock (&minor_lock);
+ usb_minors[intf->minor] = NULL;
+ spin_unlock (&minor_lock);
+- retval = PTR_ERR(intf->class_dev);
++ retval = PTR_ERR(intf->usb_dev);
+ }
+ exit:
+ return retval;
+@@ -206,8 +205,8 @@ void usb_deregister_dev(struct usb_inter
+ spin_unlock (&minor_lock);
+
+ snprintf(name, BUS_ID_SIZE, class_driver->name, intf->minor - minor_base);
+- class_device_destroy(usb_class, MKDEV(USB_MAJOR, intf->minor));
+- intf->class_dev = NULL;
++ device_destroy(usb_class, MKDEV(USB_MAJOR, intf->minor));
++ intf->usb_dev = NULL;
+ intf->minor = -1;
+ }
+ EXPORT_SYMBOL(usb_deregister_dev);
+--- gregkh-2.6.orig/include/linux/usb.h
++++ gregkh-2.6/include/linux/usb.h
+@@ -104,7 +104,8 @@ enum usb_interface_condition {
+ * @condition: binding state of the interface: not bound, binding
+ * (in probe()), bound to a driver, or unbinding (in disconnect())
+ * @dev: driver model's view of this device
+- * @class_dev: driver model's class view of this device.
++ * @usb_dev: if an interface is bound to the USB major, this will point
++ * to the sysfs representation for that device.
+ *
+ * USB device drivers attach to interfaces on a physical device. Each
+ * interface encapsulates a single high level function, such as feeding
+@@ -144,7 +145,7 @@ struct usb_interface {
+ * bound to */
+ enum usb_interface_condition condition; /* state of binding */
+ struct device dev; /* interface specific device info */
+- struct class_device *class_dev;
++ struct device *usb_dev; /* pointer to the usb class's device, if any */
+ };
+ #define to_usb_interface(d) container_of(d, struct usb_interface, dev)
+ #define interface_to_usbdev(intf) \