From: Yoshihiro Shimoda Date: Mon, 13 Mar 2017 06:25:23 +0000 (+0900) Subject: usb: host: ehci-platform: set hcd->phy to avoid phy_get() in usb_add_hcd() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=42a58c9949ddf16e557f5c2e22566f3440e7b60f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git usb: host: ehci-platform: set hcd->phy to avoid phy_get() in usb_add_hcd() 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 --- 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]; } }