diff options
author | Mathias Nyman <mathias.nyman@linux.intel.com> | 2018-05-21 15:40:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-24 18:03:08 +0200 |
commit | eaefcf246b56ec888ccbbb6b39da688166d4d4fb (patch) | |
tree | c8ddf76600cf6a48a877ac699339d6d5a6bbafab /drivers/usb/host/xhci-ring.c | |
parent | xhci: change xhci_set_link_state() to work with port structures (diff) | |
download | linux-eaefcf246b56ec888ccbbb6b39da688166d4d4fb.tar.xz linux-eaefcf246b56ec888ccbbb6b39da688166d4d4fb.zip |
xhci: change xhci_test_and_clear_bit() to use new port structure
Don't use pointers to port array and port index as function parameters
in xhci_test_and_clear_bit(), just use a pointer to the right port
structure.
xhci_test_and_clear_bit() was the last port_array user in
xhci_get_port_status() and handle_port_status(), so remove the
port_array from them as well.
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-ring.c')
-rw-r--r-- | drivers/usb/host/xhci-ring.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 6e4211eea0e2..f0a99aa0ac58 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1527,7 +1527,6 @@ static void handle_port_status(struct xhci_hcd *xhci, int slot_id; unsigned int hcd_portnum; struct xhci_bus_state *bus_state; - __le32 __iomem **port_array; bool bogus_port_status = false; struct xhci_port *port; @@ -1555,11 +1554,6 @@ static void handle_port_status(struct xhci_hcd *xhci, hcd = port->rhub->hcd; bus_state = &xhci->bus_state[hcd_index(hcd)]; - if (hcd->speed >= HCD_USB3) - port_array = xhci->usb3_ports; - else - port_array = xhci->usb2_ports; - hcd_portnum = port->hcd_portnum; portsc = readl(port->addr); @@ -1589,8 +1583,7 @@ static void handle_port_status(struct xhci_hcd *xhci, * device and host initiated resume. */ bus_state->port_remote_wakeup |= 1 << hcd_portnum; - xhci_test_and_clear_bit(xhci, port_array, - hcd_portnum, PORT_PLC); + xhci_test_and_clear_bit(xhci, port, PORT_PLC); xhci_set_link_state(xhci, port, XDEV_U0); /* Need to wait until the next link state change * indicates the device is actually in U0. @@ -1628,8 +1621,7 @@ static void handle_port_status(struct xhci_hcd *xhci, xhci_ring_device(xhci, slot_id); if (bus_state->port_remote_wakeup & (1 << hcd_portnum)) { bus_state->port_remote_wakeup &= ~(1 << hcd_portnum); - xhci_test_and_clear_bit(xhci, port_array, - hcd_portnum, PORT_PLC); + xhci_test_and_clear_bit(xhci, port, PORT_PLC); usb_wakeup_notification(hcd->self.root_hub, hcd_portnum + 1); bogus_port_status = true; @@ -1651,8 +1643,7 @@ static void handle_port_status(struct xhci_hcd *xhci, } if (hcd->speed < HCD_USB3) - xhci_test_and_clear_bit(xhci, port_array, hcd_portnum, - PORT_PLC); + xhci_test_and_clear_bit(xhci, port, PORT_PLC); cleanup: /* Update event ring dequeue pointer before dropping the lock */ |