From patchwork Tue Jun 25 06:39:43 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: 18096 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f70.google.com (mail-vb0-f70.google.com [209.85.212.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5F8A225D00 for ; Tue, 25 Jun 2013 06:40:53 +0000 (UTC) Received: by mail-vb0-f70.google.com with SMTP id q12sf16204851vbe.9 for ; Mon, 24 Jun 2013 23:40:53 -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=7rcgcA1FyMN7iSDRZrn49+54Erq7dicRk4cNAL/BoRs=; b=mcedoDCzWpib1sNlF8Qu6WzbQxaMo3rLdjqVGzyoEsR1RjnBW4qFBPvMugS5XpN6rz XMHl4YyN7icVK4HIQwlLwOwkZKfJ8g1Kl2v1vVvfw0Cgms4R1RABespCh4rZHI5yIq3r eyZazqgazE1BNqZokMZ5RLYNlg1kxGfPSed9tjDFs8IsHrk9RK7HIqQOYnNn7XmCUyZI RwS14XKw1vyQTtdsGfS5jp6s8tBiLvhygCDQItGMilFO9YxU6uxY+eop49oYohkptO6R QAE0YsVUR60MbL1fb5rmim7GhSGgAdTxNpvW1poGG/zb2UyRQyr6oN8/S1x+hOx8uUL3 16BQ== X-Received: by 10.236.206.105 with SMTP id k69mr15244744yho.8.1372142453200; Mon, 24 Jun 2013 23:40:53 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.39.201 with SMTP id r9ls2277471qek.72.gmail; Mon, 24 Jun 2013 23:40:53 -0700 (PDT) X-Received: by 10.58.226.199 with SMTP id ru7mr13093116vec.68.1372142453038; Mon, 24 Jun 2013 23:40:53 -0700 (PDT) Received: from mail-ve0-x22c.google.com (mail-ve0-x22c.google.com [2607:f8b0:400c:c01::22c]) by mx.google.com with ESMTPS id sz6si5870425vdc.140.2013.06.24.23.40.53 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:53 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c01::22c 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::22c; Received: by mail-ve0-f172.google.com with SMTP id jz10so9792868veb.3 for ; Mon, 24 Jun 2013 23:40:53 -0700 (PDT) X-Received: by 10.58.251.144 with SMTP id zk16mr13181759vec.37.1372142452969; Mon, 24 Jun 2013 23:40:52 -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 yu8csp55573veb; Mon, 24 Jun 2013 23:40:52 -0700 (PDT) X-Received: by 10.66.0.7 with SMTP id 7mr30391168paa.199.1372142451981; Mon, 24 Jun 2013 23:40:51 -0700 (PDT) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [2607:f8b0:400e:c03::232]) by mx.google.com with ESMTPS id zo4si10632289pbc.49.2013.06.24.23.40.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:51 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400e:c03::232 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=2607:f8b0:400e:c03::232; Received: by mail-pa0-f50.google.com with SMTP id fb1so12015775pad.23 for ; Mon, 24 Jun 2013 23:40:51 -0700 (PDT) X-Received: by 10.68.179.225 with SMTP id dj1mr16985651pbc.193.1372142451581; Mon, 24 Jun 2013 23:40:51 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id mr3sm6037160pbb.27.2013.06.24.23.40.46 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 23:40:51 -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: Tue, 25 Jun 2013 12:09:43 +0530 Message-Id: <1372142386-10691-9-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1372142386-10691-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQk9KT5bpNKokihPTTGk34DjHvidRO9D1F4NmGQy5XWui+1Y9bo8gABgcRulx9eQMVzB52Jk X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c01::22c 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 Acked-by: Alan Stern Cc: Arnd Bergmann 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)