summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Neronin <niklas.neronin@linux.intel.com>2026-04-02 16:13:39 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-04-02 15:55:38 +0200
commitd81a5580845875de1f3e7156b2317f89bf81a936 (patch)
tree6e6b7eaa34f7f595038ed2fb4af0f6b5895621f5
parent5dfc7f985f09f998fa3a384d79ea6c64fbc7afd8 (diff)
usb: xhci: simpilfy resume root hub code
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>
-rw-r--r--drivers/usb/host/xhci.c36
1 files changed, 16 insertions, 20 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index ece3ff7916ff..6d27c471d4da 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -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);
}
/*