]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
usb: xhci: simpilfy resume root hub code
authorNiklas Neronin <niklas.neronin@linux.intel.com>
Thu, 2 Apr 2026 13:13:39 +0000 (16:13 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2026 13:55:38 +0000 (15:55 +0200)
Resume roothubs without checking 'retval' value, as it is always '0'.
Due to changes made in commit 79989bd4ab86 ("xhci: always resume roothubs
if xHC was reset during resume") the check is redundant.

Signed-off-by: Niklas Neronin <niklas.neronin@linux.intel.com>
Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Link: https://patch.msgid.link/20260402131342.2628648-23-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c

index ece3ff7916fffba10d58bc088e8375d8e137e58e..6d27c471d4da600e472cc8896c62e2794463392b 100644 (file)
@@ -1245,29 +1245,25 @@ int xhci_resume(struct xhci_hcd *xhci, bool power_lost, bool is_auto_resume)
 
        xhci_dbc_resume(xhci);
 
-       if (retval == 0) {
-               /*
-                * Resume roothubs only if there are pending events.
-                * USB 3 devices resend U3 LFPS wake after a 100ms delay if
-                * the first wake signalling failed, give it that chance if
-                * there are suspended USB 3 devices.
-                */
-               if (xhci->usb3_rhub.bus_state.suspended_ports ||
-                   xhci->usb3_rhub.bus_state.bus_suspended)
-                       suspended_usb3_devs = true;
+       /*
+        * Resume roothubs only if there are pending events.
+        * USB 3 devices resend U3 LFPS wake after a 100ms delay if
+        * the first wake signalling failed, give it that chance if
+        * there are suspended USB 3 devices.
+        */
+       if (xhci->usb3_rhub.bus_state.suspended_ports || xhci->usb3_rhub.bus_state.bus_suspended)
+               suspended_usb3_devs = true;
 
+       pending_portevent = xhci_pending_portevent(xhci);
+       if (suspended_usb3_devs && !pending_portevent && is_auto_resume) {
+               msleep(120);
                pending_portevent = xhci_pending_portevent(xhci);
+       }
 
-               if (suspended_usb3_devs && !pending_portevent && is_auto_resume) {
-                       msleep(120);
-                       pending_portevent = xhci_pending_portevent(xhci);
-               }
-
-               if (pending_portevent) {
-                       if (xhci->shared_hcd)
-                               usb_hcd_resume_root_hub(xhci->shared_hcd);
-                       usb_hcd_resume_root_hub(hcd);
-               }
+       if (pending_portevent) {
+               if (xhci->shared_hcd)
+                       usb_hcd_resume_root_hub(xhci->shared_hcd);
+               usb_hcd_resume_root_hub(hcd);
        }
 
        /*