From patchwork Thu Jul 25 10:53:57 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: 18566 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 25CF525DF6 for ; Thu, 25 Jul 2013 10:54:42 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id ox1sf518639veb.10 for ; Thu, 25 Jul 2013 03:54:41 -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=lmEo1fDZBLqLPQL273rjqVu/3Nk3HW4DoK6FKYl5kbqZjwdq0EXKLrobSyA9SJGxwa KQ2y5erygbRfsNRSNxfDLyylbmbOGZXwtTr4PEm+EJs2HYG182m+RRLzKKWe4Jcjz8He 5ElkE5xZwtrVdqoNVaeTXEhzGi82xquHwaItkAvk8p5YsoeIRPgfNychUK9Y66Lqzxkj TauMRz2FJ6oS3Is2d8L/7p29nq04EJiDk30qVawjfN2Hb0jEksRnm3UpTy/nHgf9x4R6 KnV6lNgSucsBWDP51wjmXVGxjr6AdcsyHMDRE9bAkzoyh04ndVRDomohUibdlF6dqWs8 1Nog== X-Received: by 10.224.64.202 with SMTP id f10mr39097145qai.2.1374749681819; Thu, 25 Jul 2013 03:54:41 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.50.167 with SMTP id d7ls647158qeo.25.gmail; Thu, 25 Jul 2013 03:54:41 -0700 (PDT) X-Received: by 10.58.234.161 with SMTP id uf1mr17138834vec.57.1374749681716; Thu, 25 Jul 2013 03:54:41 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id xb6si12160029vdb.94.2013.07.25.03.54.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id c13so392001vea.35 for ; Thu, 25 Jul 2013 03:54:41 -0700 (PDT) X-Received: by 10.220.203.197 with SMTP id fj5mr225349vcb.60.1374749681601; Thu, 25 Jul 2013 03:54:41 -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 yu8csp71170veb; Thu, 25 Jul 2013 03:54:41 -0700 (PDT) X-Received: by 10.68.171.35 with SMTP id ar3mr46960047pbc.61.1374749680568; Thu, 25 Jul 2013 03:54:40 -0700 (PDT) Received: from mail-pa0-f42.google.com (mail-pa0-f42.google.com [209.85.220.42]) by mx.google.com with ESMTPS id pn6si29862237pbb.51.2013.07.25.03.54.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:40 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.42 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.220.42; Received: by mail-pa0-f42.google.com with SMTP id lj1so1867482pab.1 for ; Thu, 25 Jul 2013 03:54:40 -0700 (PDT) X-Received: by 10.68.104.101 with SMTP id gd5mr47258471pbb.132.1374749680162; Thu, 25 Jul 2013 03:54:40 -0700 (PDT) Received: from localhost.localdomain ([223.239.156.49]) by mx.google.com with ESMTPSA id nm10sm53355013pbc.28.2013.07.25.03.54.37 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 25 Jul 2013 03:54:39 -0700 (PDT) From: Manjunath Goudar To: manjunath.goudar@linaro.org Cc: arnd@linaro.org, patches@linaro.org Subject: [PATCH V4 08/11] USB: OHCI: Properly handle ohci-platform suspend Date: Thu, 25 Jul 2013 16:23:57 +0530 Message-Id: <1374749640-30062-9-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> References: <1374749640-30062-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQlBr3kCQCwytkb+luaastwPR2uo5i+0oFl39BUXhfzXWIA8FM8je9StHTts3B15FufOwr6Q X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.176 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)