From: Frank Wang Date: Thu, 15 Dec 2016 02:50:54 +0000 (+0800) Subject: usb: ehci/ohci-platform: assigned hcd phy phandle at platform probe X-Git-Tag: firefly_0821_release~1053 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e4ec9fa3ca44b58efcddcabe75b2561c131e2852;p=firefly-linux-kernel-4.4.55.git usb: ehci/ohci-platform: assigned hcd phy phandle at platform probe In ehci/ohci-platform, phy_power_on() gets called twice at probe time, one is at pdata->power_on(); another is in usb_add_hcd(). However, phy_power_off() is only invoked one time when ehci/ohci-platform goes to PM suspend. As a result, the phy power count become inconsistent. This adds assigned phy phandle to hcd-phy at ehci/ohci-platform probe time to prevent hcd invoking generic phy methods again when phy-cells is 0 in DT. Change-Id: I2f0cca622d31a46dea0b805b83b676cc78e4d67c Signed-off-by: Frank Wang --- diff --git a/drivers/usb/host/ehci-platform.c b/drivers/usb/host/ehci-platform.c index 5756dc8e8e00..77bca46edb86 100644 --- a/drivers/usb/host/ehci-platform.c +++ b/drivers/usb/host/ehci-platform.c @@ -290,6 +290,8 @@ static int ehci_platform_probe(struct platform_device *dev) } hcd->rsrc_start = res_mem->start; hcd->rsrc_len = resource_size(res_mem); + if (priv->num_phys == 1) + hcd->phy = priv->phys[0]; err = usb_add_hcd(hcd, irq, IRQF_SHARED); if (err) diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index c2669f185f65..d7a410628748 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -250,6 +250,8 @@ static int ohci_platform_probe(struct platform_device *dev) } hcd->rsrc_start = res_mem->start; hcd->rsrc_len = resource_size(res_mem); + if (priv->num_phys == 1) + hcd->phy = priv->phys[0]; err = usb_add_hcd(hcd, irq, IRQF_SHARED); if (err)