diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:23:21 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-07 22:23:21 -0500 |
commit | c96e2c92072d3e78954c961f53d8c7352f7abbd7 (patch) | |
tree | d844f26f926ff40e98e9eae0e11fd71acad81df4 /drivers/usb/core/devio.c | |
parent | f2aca47dc3c2d0c2d5dbd972558557e74232bbce (diff) | |
parent | 64358164f5bfe5e11d4040c1eb674c29e1436ce5 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6: (70 commits)
USB: remove duplicate device id from zc0301
USB: remove duplicate device id from usb_storage
USB: remove duplicate device id from keyspan
USB: remove duplicate device id from ftdi_sio
USB: remove duplicate device id from visor
USB: a bit more coding style cleanup
usbcore: trivial whitespace fixes
usb-storage: use first bulk endpoints, not last
EHCI: fix interrupt-driven remote wakeup
USB: switch ehci-hcd to new polling scheme
USB: autosuspend for usb printer driver
USB Input: Added kernel module to support all GTCO CalComp USB InterWrite School products
USB: Sierra Wireless auto set D0
USB: usb ethernet gadget recognizes HUSB2DEV
USB: list atmel husb2_udc gadget controller
USB: gadgetfs AIO tweaks
USB: gadgetfs behaves better on userspace init bug
USB: gadgetfs race fix
USB: gadgetfs simplifications
USB: gadgetfs cleanups
...
Diffstat (limited to 'drivers/usb/core/devio.c')
-rw-r--r-- | drivers/usb/core/devio.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 4b3a6ab29bd3..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); |
@@ -1596,19 +1597,19 @@ static int usbdev_add(struct usb_device *dev) | |||
1596 | { | 1597 | { |
1597 | int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); | 1598 | int minor = ((dev->bus->busnum-1) * 128) + (dev->devnum-1); |
1598 | 1599 | ||
1599 | dev->class_dev = class_device_create(usb_device_class, NULL, | 1600 | dev->usbfs_dev = device_create(usb_device_class, &dev->dev, |
1600 | MKDEV(USB_DEVICE_MAJOR, minor), &dev->dev, | 1601 | MKDEV(USB_DEVICE_MAJOR, minor), |
1601 | "usbdev%d.%d", dev->bus->busnum, dev->devnum); | 1602 | "usbdev%d.%d", dev->bus->busnum, dev->devnum); |
1602 | if (IS_ERR(dev->class_dev)) | 1603 | if (IS_ERR(dev->usbfs_dev)) |
1603 | return PTR_ERR(dev->class_dev); | 1604 | return PTR_ERR(dev->usbfs_dev); |
1604 | 1605 | ||
1605 | dev->class_dev->class_data = dev; | 1606 | dev->usbfs_dev->platform_data = dev; |
1606 | return 0; | 1607 | return 0; |
1607 | } | 1608 | } |
1608 | 1609 | ||
1609 | static void usbdev_remove(struct usb_device *dev) | 1610 | static void usbdev_remove(struct usb_device *dev) |
1610 | { | 1611 | { |
1611 | class_device_unregister(dev->class_dev); | 1612 | device_unregister(dev->usbfs_dev); |
1612 | } | 1613 | } |
1613 | 1614 | ||
1614 | static int usbdev_notify(struct notifier_block *self, unsigned long action, | 1615 | static int usbdev_notify(struct notifier_block *self, unsigned long action, |