summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorMathias Nyman <mathias.nyman@linux.intel.com>2016-11-11 16:13:11 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-11-14 12:18:21 +0300
commit99154fd3aa9ce49f0fb842f2b07f174ae7345b64 (patch)
tree176ce87acb8d483d6c00c6f70a9f9728cd13e077 /drivers/usb/host
parentcf5d344e13655df2fcb049ae212fe59c617349a7 (diff)
downloadlinux-99154fd3aa9ce49f0fb842f2b07f174ae7345b64.tar.xz
xhci: cleanup error message if halting the host failed.
The old error message always stated that host was not halted even after trying a certain time. Host may fail the halt immediately as well with -ENODEV if device is removed and returns 0xffffffff. Use a more generic error message and show return value to know if we failed with -ETIMEDOUT or -ENODEV 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')
-rw-r--r--drivers/usb/host/xhci.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 1a4ca02729c2..b503189b98b0 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -113,12 +113,12 @@ int xhci_halt(struct xhci_hcd *xhci)
ret = xhci_handshake(&xhci->op_regs->status,
STS_HALT, STS_HALT, XHCI_MAX_HALT_USEC);
- if (!ret) {
- xhci->xhc_state |= XHCI_STATE_HALTED;
- xhci->cmd_ring_state = CMD_RING_STATE_STOPPED;
- } else
- xhci_warn(xhci, "Host not halted after %u microseconds.\n",
- XHCI_MAX_HALT_USEC);
+ if (ret) {
+ xhci_warn(xhci, "Host halt failed, %d\n", ret);
+ return ret;
+ }
+ xhci->xhc_state |= XHCI_STATE_HALTED;
+ xhci->cmd_ring_state = CMD_RING_STATE_STOPPED;
return ret;
}