Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753331Ab2JHNOA (ORCPT ); Mon, 8 Oct 2012 09:14:00 -0400 Received: from zmc.proxad.net ([212.27.53.206]:32963 "EHLO zmc.proxad.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753090Ab2JHNNp (ORCPT ); Mon, 8 Oct 2012 09:13:45 -0400 From: Florian Fainelli To: stern@rowland.harvard.edu Cc: linux-usb@vger.kernel.org, Florian Fainelli , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: [PATCH 14/32 v3] USB: ohci: remove check for RH already suspended in ohci_suspend Date: Mon, 8 Oct 2012 15:11:28 +0200 Message-Id: <1349701906-16481-15-git-send-email-florian@openwrt.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349701906-16481-1-git-send-email-florian@openwrt.org> References: <1349701906-16481-1-git-send-email-florian@openwrt.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1714 Lines: 55 As suggested by Alan Stern, the code checking for the OHCI RH already suspended is no longer required since the bug it fixes has not been seen in ages. Remove that check making ohci_suspend much simpler. Signed-off-by: Florian Fainelli --- Changes in v3: - rebased against greg's latest usb-next No changes in v2 drivers/usb/host/ohci-hcd.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 9171599..31a4616 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -989,26 +989,19 @@ static int __maybe_unused ohci_suspend(struct usb_hcd *hcd, bool do_wakeup) { struct ohci_hcd *ohci = hcd_to_ohci (hcd); unsigned long flags; - int rc = 0; - /* Root hub was already suspended. Disable irq emission and - * mark HW unaccessible, bail out if RH has been resumed. Use + /* Disable irq emission and mark HW unaccessible. Use * the spinlock to properly synchronize with possible pending * RH suspend or resume activity. */ spin_lock_irqsave (&ohci->lock, flags); - if (ohci->rh_state != OHCI_RH_SUSPENDED) { - rc = -EINVAL; - goto bail; - } ohci_writel(ohci, OHCI_INTR_MIE, &ohci->regs->intrdisable); (void)ohci_readl(ohci, &ohci->regs->intrdisable); clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); - bail: spin_unlock_irqrestore (&ohci->lock, flags); - return rc; + return 0; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/