aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/core/driver.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 13:23:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-07-26 13:23:47 -0400
commit9fc377799bc9bfd8d5cb35d0d1ea2e2458cbdbb3 (patch)
treefe93603b4e33dd50ff5f95ff769a0748b230cdf9 /drivers/usb/core/driver.c
parent5e23ae49960d05f578a73ecd19749c45af682c2b (diff)
parente387ef5c47ddeaeaa3cbdc54424cdb7a28dae2c0 (diff)
Merge tag 'usb-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB patches from Greg Kroah-Hartman: "Here's the big USB patch set for the 3.6-rc1 merge window. Lots of little changes in here, primarily for gadget controllers and drivers. There's some scsi changes that I think also went in through the scsi tree, but they merge just fine. All of these patches have been in the linux-next tree for a while now. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fix up trivial conflicts in include/scsi/scsi_device.h (same libata conflict that Jeff had already encountered) * tag 'usb-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (207 commits) usb: Add USB_QUIRK_RESET_RESUME for all Logitech UVC webcams usb: Add quirk detection based on interface information usb: s3c-hsotg: Add header file protection macros in s3c-hsotg.h USB: ehci-s5p: Add vbus setup function to the s5p ehci glue layer USB: add USB_VENDOR_AND_INTERFACE_INFO() macro USB: notify phy when root hub port connect change USB: remove 8 bytes of padding from usb_host_interface on 64 bit builds USB: option: add ZTE MF821D USB: sierra: QMI mode MC7710 moved to qcserial USB: qcserial: adding Sierra Wireless devices USB: qcserial: support generic Qualcomm serial ports USB: qcserial: make probe more flexible USB: qcserial: centralize probe exit path USB: qcserial: consolidate usb_set_interface calls USB: ehci-s5p: Add support for device tree USB: ohci-exynos: Add support for device tree USB: ehci-omap: fix compile failure(v1) usb: host: tegra: pass correct pointer in ehci_setup() USB: ehci-fsl: Update ifdef check to work on 64-bit ppc USB: serial: keyspan: Removed unrequired parentheses. ...
Diffstat (limited to 'drivers/usb/core/driver.c')
-rw-r--r--drivers/usb/core/driver.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
index f536aebc958e..445455a4429b 100644
--- a/drivers/usb/core/driver.c
+++ b/drivers/usb/core/driver.c
@@ -367,6 +367,7 @@ static int usb_probe_interface(struct device *dev)
367 return error; 367 return error;
368 368
369 err: 369 err:
370 usb_set_intfdata(intf, NULL);
370 intf->needs_remote_wakeup = 0; 371 intf->needs_remote_wakeup = 0;
371 intf->condition = USB_INTERFACE_UNBOUND; 372 intf->condition = USB_INTERFACE_UNBOUND;
372 usb_cancel_queued_reset(intf); 373 usb_cancel_queued_reset(intf);
@@ -606,30 +607,19 @@ int usb_match_device(struct usb_device *dev, const struct usb_device_id *id)
606} 607}
607 608
608/* returns 0 if no match, 1 if match */ 609/* returns 0 if no match, 1 if match */
609int usb_match_one_id(struct usb_interface *interface, 610int usb_match_one_id_intf(struct usb_device *dev,
610 const struct usb_device_id *id) 611 struct usb_host_interface *intf,
612 const struct usb_device_id *id)
611{ 613{
612 struct usb_host_interface *intf; 614 /* The interface class, subclass, protocol and number should never be
613 struct usb_device *dev;
614
615 /* proc_connectinfo in devio.c may call us with id == NULL. */
616 if (id == NULL)
617 return 0;
618
619 intf = interface->cur_altsetting;
620 dev = interface_to_usbdev(interface);
621
622 if (!usb_match_device(dev, id))
623 return 0;
624
625 /* The interface class, subclass, and protocol should never be
626 * checked for a match if the device class is Vendor Specific, 615 * checked for a match if the device class is Vendor Specific,
627 * unless the match record specifies the Vendor ID. */ 616 * unless the match record specifies the Vendor ID. */
628 if (dev->descriptor.bDeviceClass == USB_CLASS_VENDOR_SPEC && 617 if (dev->descriptor.bDeviceClass == USB_CLASS_VENDOR_SPEC &&
629 !(id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) && 618 !(id->match_flags & USB_DEVICE_ID_MATCH_VENDOR) &&
630 (id->match_flags & (USB_DEVICE_ID_MATCH_INT_CLASS | 619 (id->match_flags & (USB_DEVICE_ID_MATCH_INT_CLASS |
631 USB_DEVICE_ID_MATCH_INT_SUBCLASS | 620 USB_DEVICE_ID_MATCH_INT_SUBCLASS |
632 USB_DEVICE_ID_MATCH_INT_PROTOCOL))) 621 USB_DEVICE_ID_MATCH_INT_PROTOCOL |
622 USB_DEVICE_ID_MATCH_INT_NUMBER)))
633 return 0; 623 return 0;
634 624
635 if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) && 625 if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_CLASS) &&
@@ -644,8 +634,32 @@ int usb_match_one_id(struct usb_interface *interface,
644 (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol)) 634 (id->bInterfaceProtocol != intf->desc.bInterfaceProtocol))
645 return 0; 635 return 0;
646 636
637 if ((id->match_flags & USB_DEVICE_ID_MATCH_INT_NUMBER) &&
638 (id->bInterfaceNumber != intf->desc.bInterfaceNumber))
639 return 0;
640
647 return 1; 641 return 1;
648} 642}
643
644/* returns 0 if no match, 1 if match */
645int usb_match_one_id(struct usb_interface *interface,
646 const struct usb_device_id *id)
647{
648 struct usb_host_interface *intf;
649 struct usb_device *dev;
650
651 /* proc_connectinfo in devio.c may call us with id == NULL. */
652 if (id == NULL)
653 return 0;
654
655 intf = interface->cur_altsetting;
656 dev = interface_to_usbdev(interface);
657
658 if (!usb_match_device(dev, id))
659 return 0;
660
661 return usb_match_one_id_intf(dev, intf, id);
662}
649EXPORT_SYMBOL_GPL(usb_match_one_id); 663EXPORT_SYMBOL_GPL(usb_match_one_id);
650 664
651/** 665/**