diff options
-rw-r--r-- | drivers/usb/host/ohci-hcd.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 1382689b31db..76663295e1c7 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -1017,26 +1017,19 @@ static int __maybe_unused ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) | |||
1017 | { | 1017 | { |
1018 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | 1018 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); |
1019 | unsigned long flags; | 1019 | unsigned long flags; |
1020 | int rc = 0; | ||
1021 | 1020 | ||
1022 | /* Root hub was already suspended. Disable irq emission and | 1021 | /* Disable irq emission and mark HW unaccessible. Use |
1023 | * mark HW unaccessible, bail out if RH has been resumed. Use | ||
1024 | * the spinlock to properly synchronize with possible pending | 1022 | * the spinlock to properly synchronize with possible pending |
1025 | * RH suspend or resume activity. | 1023 | * RH suspend or resume activity. |
1026 | */ | 1024 | */ |
1027 | spin_lock_irqsave (&ohci->lock, flags); | 1025 | spin_lock_irqsave (&ohci->lock, flags); |
1028 | if (ohci->rh_state != OHCI_RH_SUSPENDED) { | ||
1029 | rc = -EINVAL; | ||
1030 | goto bail; | ||
1031 | } | ||
1032 | ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); | 1026 | ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); |
1033 | (void)ohci_readl(ohci, &ohci->regs->intrdisable); | 1027 | (void)ohci_readl(ohci, &ohci->regs->intrdisable); |
1034 | 1028 | ||
1035 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); | 1029 | clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); |
1036 | bail: | ||
1037 | spin_unlock_irqrestore (&ohci->lock, flags); | 1030 | spin_unlock_irqrestore (&ohci->lock, flags); |
1038 | 1031 | ||
1039 | return rc; | 1032 | return 0; |
1040 | } | 1033 | } |
1041 | 1034 | ||
1042 | 1035 | ||