diff options
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r-- | drivers/usb/core/devio.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 3ed4cb2d56d9..2087766f9e88 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c | |||
@@ -522,19 +522,19 @@ static int check_ctrlrecip(struct dev_state *ps, unsigned int requesttype, unsig | |||
522 | 522 | ||
523 | static struct usb_device *usbdev_lookup_minor(int minor) | 523 | static struct usb_device *usbdev_lookup_minor(int minor) |
524 | { | 524 | { |
525 | struct class_device *class_dev; | 525 | struct device *device; |
526 | struct usb_device *dev = NULL; | 526 | struct usb_device *udev = NULL; |
527 | 527 | ||
528 | down(&usb_device_class->sem); | 528 | down(&usb_device_class->sem); |
529 | list_for_each_entry(class_dev, &usb_device_class->children, node) { | 529 | list_for_each_entry(device, &usb_device_class->devices, node) { |
530 | if (class_dev->devt == MKDEV(USB_DEVICE_MAJOR, minor)) { | 530 | if (device->devt == MKDEV(USB_DEVICE_MAJOR, minor)) { |
531 | dev = class_dev->class_data; | 531 | udev = device->platform_data; |
532 | break; | 532 | break; |
533 | } | 533 | } |
534 | } | 534 | } |
535 | up(&usb_device_class->sem); | 535 | up(&usb_device_class->sem); |
536 | 536 | ||
537 | return dev; | 537 | return udev; |
538 | }; | 538 | }; |
539 | 539 | ||
540 | /* | 540 | /* |
@@ -570,6 +570,7 @@ static int usbdev_open(struct inode *inode, struct file *file) | |||
570 | ps->dev = dev; | 570 | ps->dev = dev; |
571 | ps->file = file; | 571 | ps->file = file; |
572 | spin_lock_init(&ps->lock); | 572 | spin_lock_init(&ps->lock); |
573 | INIT_LIST_HEAD(&ps->list); | ||
573 | INIT_LIST_HEAD(&ps->async_pending); | 574 | INIT_LIST_HEAD(&ps->async_pending); |
574 | INIT_LIST_HEAD(&ps->async_completed); | 575 | INIT_LIST_HEAD(&ps->async_completed); |
575 | init_waitqueue_head(&ps->wait); | 576 | init_waitqueue_head(&ps->wait); |
@@ -962,7 +963,11 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb, | |||
962 | kfree(dr); | 963 | kfree(dr); |
963 | return -EFAULT; | 964 | return -EFAULT; |
964 | } | 965 | } |
965 | snoop(&ps->dev->dev, "control urb\n"); | 966 | snoop(&ps->dev->dev, "control urb: bRequest=%02x " |
967 | "bRrequestType=%02x wValue=%04x " | ||
968 | "wIndex=%04x wLength=%04x\n", | ||
969 | dr->bRequest, dr->bRequestType, dr->wValue, | ||
970 | dr->wIndex, dr->wLength); | ||
966 | break; | 971 | break; |
967 | 972 | ||
968 | case USBDEVFS_URB_TYPE_BULK: | 973 | case USBDEVFS_URB_TYPE_BULK: |
@@ -1592,19 +1597,19 @@ static int usbdev_add(struct usb_device *dev) | |||
1592 | { | 1597 | { |
1593 | int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); | 1598 | int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); |
1594 | 1599 | ||
1595 | dev->class_dev = class_device_create(usb_device_class, NULL, | 1600 | dev->usbfs_dev = device_create(usb_device_class, &dev->dev, |
1596 | MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev, | 1601 | MKDEV(USB_DEVICE_MAJOR, minor), |
1597 | "usbdev%d.%d", dev->bus->busnum, dev->devnum); | 1602 | "usbdev%d.%d", dev->bus->busnum, dev->devnum); |
1598 | if (IS_ERR(dev->class_dev)) | 1603 | if (IS_ERR(dev->usbfs_dev)) |
1599 | return PTR_ERR(dev->class_dev); | 1604 | return PTR_ERR(dev->usbfs_dev); |
1600 | 1605 | ||
1601 | dev->class_dev->class_data = dev; | 1606 | dev->usbfs_dev->platform_data = dev; |
1602 | return 0; | 1607 | return 0; |
1603 | } | 1608 | } |
1604 | 1609 | ||
1605 | static void usbdev_remove(struct usb_device *dev) | 1610 | static void usbdev_remove(struct usb_device *dev) |
1606 | { | 1611 | { |
1607 | class_device_unregister(dev->class_dev); | 1612 | device_unregister(dev->usbfs_dev); |
1608 | } | 1613 | } |
1609 | 1614 | ||
1610 | static int usbdev_notify(struct notifier_block *self, unsigned long action, | 1615 | static int usbdev_notify(struct notifier_block *self, unsigned long action, |