From eaefcf246b56ec888ccbbb6b39da688166d4d4fb Mon Sep 17 00:00:00 2001 From: Mathias Nyman Date: Mon, 21 May 2018 16:40:00 +0300 Subject: 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci-hub.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'drivers/usb/host/xhci-hub.c') diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index e3be8d15c078..05115b81f6bd 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -717,16 +717,16 @@ static void xhci_set_remote_wake_mask(struct xhci_hcd *xhci, } /* Test and clear port RWC bit */ -void xhci_test_and_clear_bit(struct xhci_hcd *xhci, __le32 __iomem **port_array, - int port_id, u32 port_bit) +void xhci_test_and_clear_bit(struct xhci_hcd *xhci, struct xhci_port *port, + u32 port_bit) { u32 temp; - temp = readl(port_array[port_id]); + temp = readl(port->addr); if (temp & port_bit) { temp = xhci_port_state_to_neutral(temp); temp |= port_bit; - writel(temp, port_array[port_id]); + writel(temp, port->addr); } } @@ -846,8 +846,7 @@ static u32 xhci_get_ext_port_status(u32 raw_port_status, u32 port_li) */ static u32 xhci_get_port_status(struct usb_hcd *hcd, struct xhci_bus_state *bus_state, - __le32 __iomem **port_array, - u16 wIndex, u32 raw_port_status, + u16 wIndex, u32 raw_port_status, unsigned long flags) __releases(&xhci->lock) __acquires(&xhci->lock) @@ -930,8 +929,7 @@ static u32 xhci_get_port_status(struct usb_hcd *hcd, set_bit(wIndex, &bus_state->rexit_ports); - xhci_test_and_clear_bit(xhci, port_array, wIndex, - PORT_PLC); + xhci_test_and_clear_bit(xhci, port, PORT_PLC); xhci_set_link_state(xhci, port, XDEV_U0); spin_unlock_irqrestore(&xhci->lock, flags); @@ -1091,8 +1089,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, break; } trace_xhci_get_port_status(wIndex, temp); - status = xhci_get_port_status(hcd, bus_state, port_array, - wIndex, temp, flags); + status = xhci_get_port_status(hcd, bus_state, wIndex, temp, + flags); if (status == 0xffffffff) goto error; @@ -1673,7 +1671,7 @@ int xhci_bus_resume(struct usb_hcd *hcd) for_each_set_bit(port_index, &bus_state->bus_suspended, BITS_PER_LONG) { /* Clear PLC to poll it later for U0 transition */ - xhci_test_and_clear_bit(xhci, port_array, port_index, + xhci_test_and_clear_bit(xhci, ports[port_index], PORT_PLC); xhci_set_link_state(xhci, ports[port_index], XDEV_U0); } @@ -1688,7 +1686,7 @@ int xhci_bus_resume(struct usb_hcd *hcd) port_index); continue; } - xhci_test_and_clear_bit(xhci, port_array, port_index, PORT_PLC); + xhci_test_and_clear_bit(xhci, ports[port_index], PORT_PLC); slot_id = xhci_find_slot_id_by_port(hcd, xhci, port_index + 1); if (slot_id) xhci_ring_device(xhci, slot_id); -- cgit v1.2.3