aboutsummaryrefslogtreecommitdiffstats
path: root/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-06-20 00:08:54 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-20 00:08:54 -0700
commit5f9cad239c1c4ecccd8530be834263e9e898ad91 (patch)
treee10d12651c8636d9bcb9c8bf3482fd499e941051 /usb
parent0cb23f7397445db2f0280c57cfed16f5f807100f (diff)
downloadpatches-5f9cad239c1c4ecccd8530be834263e9e898ad91.tar.gz
move devio class devices to real devices and fix a bug in driver/driver-core-add-generic-subsystem-link-to-all-devices.patch
Diffstat (limited to 'usb')
-rw-r--r--usb/usb-devio-class-to-device.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/usb/usb-devio-class-to-device.patch b/usb/usb-devio-class-to-device.patch
new file mode 100644
index 0000000000000..d9b4d3c6d4b6b
--- /dev/null
+++ b/usb/usb-devio-class-to-device.patch
@@ -0,0 +1,80 @@
+From foo@baz Tue Apr 9 12:12:43 2002
+Date: Mon, 19 Jun 2006 23:59:31 -0700
+To: Greg KH <greg@kroah.com>
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Subject: USB: move usb_device_class class devices to be real devices
+
+This moves the usb class devices that control the usbfs nodes to show up
+in the proper place in the larger device tree.
+
+No userspace changes is needed, this is compatible due to the symlinks
+generated by the driver core.
+
+Cc: Kay Sievers <kay.sievers@vrfy.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/core/devio.c | 20 ++++++++++----------
+ include/linux/usb.h | 2 +-
+ 2 files changed, 11 insertions(+), 11 deletions(-)
+
+--- gregkh-2.6.orig/drivers/usb/core/devio.c
++++ gregkh-2.6/drivers/usb/core/devio.c
+@@ -515,19 +515,19 @@ static int check_ctrlrecip(struct dev_st
+
+ static struct usb_device *usbdev_lookup_minor(int minor)
+ {
+- struct class_device *class_dev;
+- struct usb_device *dev = NULL;
++ struct device *device;
++ struct usb_device *udev = NULL;
+
+ down(&usb_device_class->sem);
+- list_for_each_entry(class_dev, &usb_device_class->children, node) {
+- if (class_dev->devt == MKDEV(USB_DEVICE_MAJOR, minor)) {
+- dev = class_dev->class_data;
++ list_for_each_entry(device, &usb_device_class->devices, node) {
++ if (device->devt == MKDEV(USB_DEVICE_MAJOR, minor)) {
++ udev = device->platform_data;
+ break;
+ }
+ }
+ up(&usb_device_class->sem);
+
+- return dev;
++ return udev;
+ };
+
+ /*
+@@ -1580,16 +1580,16 @@ static void usbdev_add(struct usb_device
+ {
+ int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1);
+
+- dev->class_dev = class_device_create(usb_device_class, NULL,
+- MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev,
++ dev->usbfs_dev = device_create(usb_device_class, &dev->dev,
++ MKDEV(USB_DEVICE_MAJOR, minor),
+ "usbdev%d.%d", dev->bus->busnum, dev->devnum);
+
+- dev->class_dev->class_data = dev;
++ dev->usbfs_dev->platform_data = dev;
+ }
+
+ static void usbdev_remove(struct usb_device *dev)
+ {
+- class_device_unregister(dev->class_dev);
++ device_unregister(dev->usbfs_dev);
+ }
+
+ static int usbdev_notify(struct notifier_block *self, unsigned long action,
+--- gregkh-2.6.orig/include/linux/usb.h
++++ gregkh-2.6/include/linux/usb.h
+@@ -361,7 +361,7 @@ struct usb_device {
+ char *serial; /* iSerialNumber string, if present */
+
+ struct list_head filelist;
+- struct class_device *class_dev;
++ struct device *usbfs_dev;
+ struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */
+
+ /*