summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-mem.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-12-20 21:33:12 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2010-12-20 21:33:12 -0800
commit7bddaaca472a08bb8a80b653855a1e921b440578 (patch)
treeb41b48c4ae5da770c20ba7ce00f6fa3d76b5a2a1 /drivers/usb/host/xhci-mem.c
parent9d5004fcf6e4e8caa9efbc25c9f85059b165329c (diff)
parentdbb442b85a1d82f91cfe0524c4f9b3a5196a10ca (diff)
Merge branch 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* 'usb-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: Revert "USB: gadget: Allow function access to device ID data during bind()" USB: misc: uss720.c: add another vendor/product ID USB: usb-storage: unusual_devs entry for the Samsung YP-CP3 USB: gadget: Remove suspended sysfs file before freeing cdev USB: core: Add input prompt and help text for USB_OTG config USB: ftdi_sio: Add D.O.Tec PID xhci: Fix issue with port array setup and buggy hosts.
Diffstat (limited to 'drivers/usb/host/xhci-mem.c')
-rw-r--r--drivers/usb/host/xhci-mem.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 0fae58ef8afe..1d0f45f0e7a6 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -1680,6 +1680,7 @@ static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports,
xhci->port_array[i] = (u8) -1;
}
/* FIXME: Should we disable the port? */
+ continue;
}
xhci->port_array[i] = major_revision;
if (major_revision == 0x03)
@@ -1758,16 +1759,20 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
return -ENOMEM;
port_index = 0;
- for (i = 0; i < num_ports; i++)
- if (xhci->port_array[i] != 0x03) {
- xhci->usb2_ports[port_index] =
- &xhci->op_regs->port_status_base +
- NUM_PORT_REGS*i;
- xhci_dbg(xhci, "USB 2.0 port at index %u, "
- "addr = %p\n", i,
- xhci->usb2_ports[port_index]);
- port_index++;
- }
+ for (i = 0; i < num_ports; i++) {
+ if (xhci->port_array[i] == 0x03 ||
+ xhci->port_array[i] == 0 ||
+ xhci->port_array[i] == -1)
+ continue;
+
+ xhci->usb2_ports[port_index] =
+ &xhci->op_regs->port_status_base +
+ NUM_PORT_REGS*i;
+ xhci_dbg(xhci, "USB 2.0 port at index %u, "
+ "addr = %p\n", i,
+ xhci->usb2_ports[port_index]);
+ port_index++;
+ }
}
if (xhci->num_usb3_ports) {
xhci->usb3_ports = kmalloc(sizeof(*xhci->usb3_ports)*