From patchwork Wed Jun 19 12:12:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjunath.goudar@linaro.org X-Patchwork-Id: 17990 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 963F72397B for ; Wed, 19 Jun 2013 12:13:17 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id u12sf6841030qcx.4 for ; Wed, 19 Jun 2013 05:13:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=m2ncbwjrvHZWmUHGcc641VFdnAMpozNw8ihJNRgCa9c=; b=FK/WuzDoKwZYzRf7rmTgDIHsopTLR5D9/zwUAC4jS2pV0FGP0trFAOk6fDCQm7Vmm7 t4OPUhQe2J7ttyqvwCJXpA/AIhCZeJgfx+0wf/Ra+tW4KCNkls2h3WkHNBrsGFY4Za5/ 7dTcopuPfrIFECAECJKxsIF0sRgvWt4lWmJ6IDDwiej0DfS4WJx2JeIO+T7gw4xuqATF AtjNsWfjyDdLSTGMNVjunUqdUfRS9CG+oFtZY3D1pIdbUYLj2yMDzXvD7wpcHLMMp7RX m41YPahHVrHkVihMihSjuWRT+zy2uIqIl0s95EJVWLreTUH5GK5KSfc1iZseQL3CZVCS zMyA== X-Received: by 10.58.135.70 with SMTP id pq6mr290215veb.22.1371643997334; Wed, 19 Jun 2013 05:13:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.49.135 with SMTP id u7ls273655qen.3.gmail; Wed, 19 Jun 2013 05:13:17 -0700 (PDT) X-Received: by 10.52.164.227 with SMTP id yt3mr680155vdb.107.1371643997203; Wed, 19 Jun 2013 05:13:17 -0700 (PDT) Received: from mail-vb0-x234.google.com (mail-vb0-x234.google.com [2607:f8b0:400c:c02::234]) by mx.google.com with ESMTPS id zp6si6447918vdb.54.2013.06.19.05.13.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:17 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::234; Received: by mail-vb0-f52.google.com with SMTP id f12so3636072vbg.39 for ; Wed, 19 Jun 2013 05:13:17 -0700 (PDT) X-Received: by 10.220.53.7 with SMTP id k7mr521573vcg.52.1371643997105; Wed, 19 Jun 2013 05:13:17 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.165.8 with SMTP id yu8csp106241veb; Wed, 19 Jun 2013 05:13:16 -0700 (PDT) X-Received: by 10.68.251.133 with SMTP id zk5mr2576103pbc.75.1371643996012; Wed, 19 Jun 2013 05:13:16 -0700 (PDT) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [2607:f8b0:400e:c03::229]) by mx.google.com with ESMTPS id zr1si10756138pbc.180.2013.06.19.05.13.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:16 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::229 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::229; Received: by mail-pa0-f41.google.com with SMTP id bj3so5108881pad.14 for ; Wed, 19 Jun 2013 05:13:15 -0700 (PDT) X-Received: by 10.66.248.68 with SMTP id yk4mr6543703pac.137.1371643995632; Wed, 19 Jun 2013 05:13:15 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id e2sm22925142pbc.23.2013.06.19.05.13.09 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 19 Jun 2013 05:13:14 -0700 (PDT) From: Manjunath Goudar To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, stern@rowland.harvard.edu, arnd@linaro.org, manjunath.goudar@linaro.org, linaro-kernel@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH V3 08/11] USB: OHCI: Properly handle ohci-platform suspend Date: Wed, 19 Jun 2013 17:42:13 +0530 Message-Id: <1371643936-3314-9-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371643936-3314-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQlC470Rb5Y+9I22J4mEGx/3uhuW+DFjxq8Tzi3LQRcvd6/rMCvdSAHJ3XAB090GCEPMvxpF X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::234 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Suspend scenario in case of ohci-platform glue was not properly handled as it was not suspending generic part of ohci controller. Calling explicitly the ohci_suspend() routine in ohci_platform_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Cc: Arnd Bergmann Cc: Alan Stern Cc: Greg KH Cc: linux-usb@vger.kernel.org V2: -Incase ohci_suspend() fails, return right away without executing further. V3: -Aligned variable "do_wakeup" and "ret". --- drivers/usb/host/ohci-platform.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index bc30475..f4830a5 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -139,14 +139,21 @@ static int ohci_platform_remove(struct platform_device *dev) static int ohci_platform_suspend(struct device *dev) { + struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_ohci_pdata *pdata = dev->platform_data; struct platform_device *pdev = container_of(dev, struct platform_device, dev); + bool do_wakeup = device_may_wakeup(dev); + int ret; + + ret = ohci_suspend(hcd, do_wakeup); + if (ret) + return ret; if (pdata->power_suspend) pdata->power_suspend(pdev); - return 0; + return ret; } static int ohci_platform_resume(struct device *dev)