From patchwork Thu Jun 20 09:36:04 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: 18011 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 65FAF2393D for ; Thu, 20 Jun 2013 09:38:29 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cr7sf2151523qab.9 for ; Thu, 20 Jun 2013 02:38:29 -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=eA1Nc2pBZ1b2ZSIjhZ01+gH7UNO3UY9DxsUas9PUPE4=; b=INgfdBOzVmpRTwhVYij24E273DhT4Ej+3m3tgwjvnN95j3qxKQogldQsj1Sj73ZL4X P8j9s6YkGwfc37u9gjl09+pe60VM3DPwYsmFzkC9oebpzgt1/rXIc5AX0lu3gJkEfjLO 6MNCXBQVPGuFwOkR6qntwWQ0sGoNKk7EjYXJWrdzO5UBHjFC/vj0RevcM9sFakS9zWLF plluQHR2qbmMHXMwGZo7PhIINgdXoKMdLp5KD7yTIHnAncNRnIVxHe9D2EMyEynzfSQC eJNtimCVMvG7wc720xpuJL5xmACxJR1++CVy0Zaq0BiNpzrzBAe3HU8zRYzZro1yrfSa TRHg== X-Received: by 10.236.143.101 with SMTP id k65mr3715776yhj.45.1371721109232; Thu, 20 Jun 2013 02:38:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.41.7 with SMTP id b7ls600190qel.12.gmail; Thu, 20 Jun 2013 02:38:29 -0700 (PDT) X-Received: by 10.220.42.147 with SMTP id s19mr2254382vce.46.1371721109063; Thu, 20 Jun 2013 02:38:29 -0700 (PDT) Received: from mail-ve0-x231.google.com (mail-ve0-x231.google.com [2607:f8b0:400c:c01::231]) by mx.google.com with ESMTPS id v6si1561895vck.76.2013.06.20.02.38.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:29 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::231 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:c01::231; Received: by mail-ve0-f177.google.com with SMTP id cz10so4814861veb.22 for ; Thu, 20 Jun 2013 02:38:29 -0700 (PDT) X-Received: by 10.52.120.77 with SMTP id la13mr2169982vdb.23.1371721108953; Thu, 20 Jun 2013 02:38:28 -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 yu8csp13842veb; Thu, 20 Jun 2013 02:38:28 -0700 (PDT) X-Received: by 10.66.232.196 with SMTP id tq4mr10807715pac.167.1371721107823; Thu, 20 Jun 2013 02:38:27 -0700 (PDT) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [2607:f8b0:400e:c03::235]) by mx.google.com with ESMTPS id ol10si13098066pbb.274.2013.06.20.02.38.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:27 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::235 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::235; Received: by mail-pa0-f53.google.com with SMTP id tj12so6132996pac.12 for ; Thu, 20 Jun 2013 02:38:27 -0700 (PDT) X-Received: by 10.68.13.168 with SMTP id i8mr6735048pbc.86.1371721107408; Thu, 20 Jun 2013 02:38:27 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.192]) by mx.google.com with ESMTPSA id kq2sm35530pab.19.2013.06.20.02.38.20 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Jun 2013 02:38:26 -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 V4 08/11] USB: OHCI: Properly handle ohci-platform suspend Date: Thu, 20 Jun 2013 15:06:04 +0530 Message-Id: <1371720968-7533-9-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1371720968-7533-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQlBI8Hbzv0wvLeB36rdMF0mi4ViJGUGFUHA2+MjS4XcAR/mYjuBpy03RCky83TmwtrwHx8/ X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::231 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". V4: -The do_wakeup and ret variable alignment is removed. --- 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..b4a8784 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)