Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

xhci: cleanup code that sets portstatus and portchange bits

Group the code where the wPortstatus and wPortChange bits
are set into one place.

No functional changes

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mathias Nyman and committed by
Greg Kroah-Hartman
3c2ddb44 70e9b53d

+14 -12
+14 -12
drivers/usb/host/xhci-hub.c
··· 891 891 rhub = xhci_get_rhub(hcd); 892 892 port = rhub->ports[wIndex]; 893 893 894 - /* wPortChange bits */ 894 + /* common wPortChange bits */ 895 895 if (raw_port_status & PORT_CSC) 896 896 status |= USB_PORT_STAT_C_CONNECTION << 16; 897 897 if (raw_port_status & PORT_PEC) ··· 901 901 if ((raw_port_status & PORT_RC)) 902 902 status |= USB_PORT_STAT_C_RESET << 16; 903 903 904 - /* USB2 and USB3 specific bits including Port Link State */ 904 + /* common wPortStatus bits */ 905 + if (raw_port_status & PORT_CONNECT) { 906 + status |= USB_PORT_STAT_CONNECTION; 907 + status |= xhci_port_speed(raw_port_status); 908 + } 909 + if (raw_port_status & PORT_PE) 910 + status |= USB_PORT_STAT_ENABLE; 911 + if (raw_port_status & PORT_OC) 912 + status |= USB_PORT_STAT_OVERCURRENT; 913 + if (raw_port_status & PORT_RESET) 914 + status |= USB_PORT_STAT_RESET; 915 + 916 + /* USB2 and USB3 specific bits, including Port Link State */ 905 917 if (hcd->speed >= HCD_USB3) 906 918 xhci_get_usb3_port_status(port, &status, raw_port_status); 907 919 else ··· 1022 1010 bus_state->resume_done[wIndex] = 0; 1023 1011 clear_bit(wIndex, &bus_state->resuming_ports); 1024 1012 } 1025 - if (raw_port_status & PORT_CONNECT) { 1026 - status |= USB_PORT_STAT_CONNECTION; 1027 - status |= xhci_port_speed(raw_port_status); 1028 - } 1029 - if (raw_port_status & PORT_PE) 1030 - status |= USB_PORT_STAT_ENABLE; 1031 - if (raw_port_status & PORT_OC) 1032 - status |= USB_PORT_STAT_OVERCURRENT; 1033 - if (raw_port_status & PORT_RESET) 1034 - status |= USB_PORT_STAT_RESET; 1035 1013 1036 1014 if (bus_state->port_c_suspend & (1 << wIndex)) 1037 1015 status |= USB_PORT_STAT_C_SUSPEND << 16;