aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-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,
1680 xhci->port_array[i] = (u8) -1; 1680 xhci->port_array[i] = (u8) -1;
1681 } 1681 }
1682 /* FIXME: Should we disable the port? */ 1682 /* FIXME: Should we disable the port? */
1683 continue;
1683 } 1684 }
1684 xhci->port_array[i] = major_revision; 1685 xhci->port_array[i] = major_revision;
1685 if (major_revision == 0x03) 1686 if (major_revision == 0x03)
@@ -1758,16 +1759,20 @@ static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags)
1758 return -ENOMEM; 1759 return -ENOMEM;
1759 1760
1760 port_index = 0; 1761 port_index = 0;
1761 for (i = 0; i < num_ports; i++) 1762 for (i = 0; i < num_ports; i++) {
1762 if (xhci->port_array[i] != 0x03) { 1763 if (xhci->port_array[i] == 0x03 ||
1763 xhci->usb2_ports[port_index] = 1764 xhci->port_array[i] == 0 ||
1764 &xhci->op_regs->port_status_base + 1765 xhci->port_array[i] == -1)
1765 NUM_PORT_REGS*i; 1766 continue;
1766 xhci_dbg(xhci, "USB 2.0 port at index %u, " 1767
1767 "addr = %p\n", i, 1768 xhci->usb2_ports[port_index] =
1768 xhci->usb2_ports[port_index]); 1769 &xhci->op_regs->port_status_base +
1769 port_index++; 1770 NUM_PORT_REGS*i;
1770 } 1771 xhci_dbg(xhci, "USB 2.0 port at index %u, "
1772 "addr = %p\n", i,
1773 xhci->usb2_ports[port_index]);
1774 port_index++;
1775 }
1771 } 1776 }
1772 if (xhci->num_usb3_ports) { 1777 if (xhci->num_usb3_ports) {
1773 xhci->usb3_ports = kmalloc(sizeof(*xhci->usb3_ports)* 1778 xhci->usb3_ports = kmalloc(sizeof(*xhci->usb3_ports)*