From patchwork Mon Jul 22 09:32: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: 18476 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f72.google.com (mail-vb0-f72.google.com [209.85.212.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 72FB225E1F for ; Mon, 22 Jul 2013 09:33:42 +0000 (UTC) Received: by mail-vb0-f72.google.com with SMTP id p12sf8337302vbe.7 for ; Mon, 22 Jul 2013 02:33:42 -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=hoc+eq84xUZgbx7IagnKNPscoWMv7pkGI/Lw++MQZacmEgczcqBkv7ZVI1V12lEJ+B ezkvq2kg+2VQkcM9NNgyZqG1eD7pQAjkP3fPswmCy/xUGOHLocIM/Y1xZOdoBGXMHRzE qMAiSPM6MQf7EXby1juMlmbKKFq4Ge0PvhIoOjIsn0CXkqfBf23J9eyJnjT3tHD6kJy5 GMU+gKZHK+iMxFMjoLXdhwi4q2jnxlA7Aytl4xkBq9mg/Iz0wWcZ+cjvU1MKOBDqMXcv 0OlEa1T3Va1Uo+LevUTe9/g1X+U/DsGSQKN3e/hH5GFIJz8gI/vq4juZZElmSZ9RvfVj Me/g== X-Received: by 10.236.140.40 with SMTP id d28mr4529105yhj.24.1374485622184; Mon, 22 Jul 2013 02:33:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.88.6 with SMTP id bc6ls1007721qeb.73.gmail; Mon, 22 Jul 2013 02:33:42 -0700 (PDT) X-Received: by 10.58.97.238 with SMTP id ed14mr1372349veb.34.1374485622087; Mon, 22 Jul 2013 02:33:42 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id u5si6837379vet.114.2013.07.22.02.33.42 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 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.170; Received: by mail-ve0-f170.google.com with SMTP id 14so4911114vea.15 for ; Mon, 22 Jul 2013 02:33:42 -0700 (PDT) X-Received: by 10.52.35.109 with SMTP id g13mr7639803vdj.21.1374485621984; Mon, 22 Jul 2013 02:33: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 yu8csp46451veb; Mon, 22 Jul 2013 02:33:41 -0700 (PDT) X-Received: by 10.66.246.133 with SMTP id xw5mr30071347pac.114.1374485621008; Mon, 22 Jul 2013 02:33:41 -0700 (PDT) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id c10si15598035pav.229.2013.07.22.02.33.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.160.41; Received: by mail-pb0-f41.google.com with SMTP id rp16so6882941pbb.0 for ; Mon, 22 Jul 2013 02:33:40 -0700 (PDT) X-Received: by 10.68.76.101 with SMTP id j5mr29917674pbw.67.1374485620598; Mon, 22 Jul 2013 02:33:40 -0700 (PDT) Received: from localhost.localdomain ([223.239.144.229]) by mx.google.com with ESMTPSA id bb1sm24977759pbc.10.2013.07.22.02.33.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 22 Jul 2013 02:33:39 -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 08/11] USB: OHCI: Properly handle ohci-platform suspend Date: Mon, 22 Jul 2013 15:02:43 +0530 Message-Id: <1374485566-3997-9-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> <1374485566-3997-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQlxGE13e1EG9HpMWbL44BN+xEnc196coPp4D5K5qQ+2Vx2g8ljkmQ6sjhVbR6AHdwSVX+z3 X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.170 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)