aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2006-06-20 02:59:31 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-21 18:04:19 -0400
commitc182274ffe1277f4e7c564719a696a37cacf74ea (patch)
tree0e9df4d75ff12dcefad3058b3509b2f2b09202bc /drivers/usb
parent9bde7497e0b54178c317fac47a18be7f948dd471 (diff)
[PATCH] 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>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/core/devio.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
index 2eda52fc1ebc..3f8e06279c92 100644
--- a/drivers/usb/core/devio.c
+++ b/drivers/usb/core/devio.c
@@ -515,19 +515,19 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, unsig
515 515
516static struct usb_device *usbdev_lookup_minor(int minor) 516static struct usb_device *usbdev_lookup_minor(int minor)
517{ 517{
518 struct class_device *class_dev; 518 struct device *device;
519 struct usb_device *dev = NULL; 519 struct usb_device *udev = NULL;
520 520
521 down(&usb_device_class->sem); 521 down(&usb_device_class->sem);
522 list_for_each_entry(class_dev, &usb_device_class->children, node) { 522 list_for_each_entry(device, &usb_device_class->devices, node) {
523 if (class_dev->devt == MKDEV(USB_DEVICE_MAJOR, minor)) { 523 if (device->devt == MKDEV(USB_DEVICE_MAJOR, minor)) {
524 dev = class_dev->class_data; 524 udev = device->platform_data;
525 break; 525 break;
526 } 526 }
527 } 527 }
528 up(&usb_device_class->sem); 528 up(&usb_device_class->sem);
529 529
530 return dev; 530 return udev;
531}; 531};
532 532
533/* 533/*
@@ -1580,16 +1580,16 @@ static void usbdev_add(struct usb_device *dev)
1580{ 1580{
1581 int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); 1581 int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1);
1582 1582
1583 dev->class_dev = class_device_create(usb_device_class, NULL, 1583 dev->usbfs_dev = device_create(usb_device_class, &dev->dev,
1584 MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev, 1584 MKDEV(USB_DEVICE_MAJOR, minor),
1585 "usbdev%d.%d", dev->bus->busnum, dev->devnum); 1585 "usbdev%d.%d", dev->bus->busnum, dev->devnum);
1586 1586
1587 dev->class_dev->class_data = dev; 1587 dev->usbfs_dev->platform_data = dev;
1588} 1588}
1589 1589
1590static void usbdev_remove(struct usb_device *dev) 1590static void usbdev_remove(struct usb_device *dev)
1591{ 1591{
1592 class_device_unregister(dev->class_dev); 1592 device_unregister(dev->usbfs_dev);
1593} 1593}
1594 1594
1595static int usbdev_notify(struct notifier_block *self, unsigned long action, 1595static int usbdev_notify(struct notifier_block *self, unsigned long action,