From patchwork Tue Sep 5 08:06:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 9938195 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 46B1D608A6 for ; Tue, 5 Sep 2017 08:18:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36900288ED for ; Tue, 5 Sep 2017 08:18:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2B47D288FA; Tue, 5 Sep 2017 08:18:27 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9317128904 for ; Tue, 5 Sep 2017 08:18:25 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 43A04AEF; Tue, 5 Sep 2017 08:17:39 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id CE0C7A86 for ; Tue, 5 Sep 2017 08:17:36 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from kirsty.vergenet.net (kirsty.vergenet.net [202.4.237.240]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 38B191F2 for ; Tue, 5 Sep 2017 08:17:36 +0000 (UTC) Received: from penelope.horms.nl (88.red-79-157-204.dynamicip.rima-tde.net [79.157.204.88]) by kirsty.vergenet.net (Postfix) with ESMTPA id 8818F25BE9A; Tue, 5 Sep 2017 18:07:45 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=verge.net.au; s=mail; t=1504598866; bh=VFjaiSMuYM/Lyg39pNTQXIVi/pd9f58KV11Ptapl1Ao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kuzrIDnMOwLj3dGzsxHfeCUIN2xhGiN/R5gKUDJ3/BaFhR3Ec8BYwkEljczddxy0s vtBycN3C9kJ2MK+cxVhTOIGT4eyvv3y40ziREFDFLcBofiEoJgQtJxEKXtvnBKHDjk 6BepwvavG3hzq+9qPJ6uez4ToFr/qJg2Cv4oUQTE= Received: by penelope.horms.nl (Postfix, from userid 7100) id F1021E2349C; Tue, 5 Sep 2017 04:06:59 -0400 (EDT) From: Simon Horman To: Greg KH Date: Tue, 5 Sep 2017 10:06:46 +0200 Message-Id: <1504598808-19810-12-git-send-email-horms@verge.net.au> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1504598808-19810-1-git-send-email-horms@verge.net.au> References: <1504598808-19810-1-git-send-email-horms@verge.net.au> Cc: ltsi-dev@lists.linuxfoundation.org, linux-renesas-soc@vger.kernel.org, Magnus Damm Subject: [LTSI-dev] [PATCH 11/13] usb: host: ehci-platform: set hcd->phy to avoid phy_get() in usb_add_hcd() X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yoshihiro Shimoda This patch sets hcd->phy from own phy context to avoid phy_get() in usb_add_hcd(). Since core/hcd.c manages the phy only in usb_add_hcd() and usb_remove_hcd(), there is difficult to manage the phy in suspend/resume. Signed-off-by: Yoshihiro Shimoda Acked-by: Alan Stern Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 42a58c9949ddf16e557f5c2e22566f3440e7b60f) Signed-off-by: Simon Horman --- drivers/usb/host/ehci-platform.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index 3214300396a0..bc7b9be12f54 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -221,6 +221,9 @@ static int ehci_platform_probe(struct platform_device *dev) if (IS_ERR(priv->phys[phy_num])) { err = PTR_ERR(priv->phys[phy_num]); goto err_put_hcd; + } else if (!hcd->phy) { + /* Avoiding phy_get() in usb_add_hcd() */ + hcd->phy = priv->phys[phy_num]; } }