diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2017-03-13 09:25:24 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-03-17 07:35:25 +0300 |
commit | d3d6ef1fb908b286a610fe063613e519bc50178b (patch) | |
tree | 7a35232a057555e86ae206676a8f263cf7f1d130 /drivers/usb/host/ohci-platform.c | |
parent | 42a58c9949ddf16e557f5c2e22566f3440e7b60f (diff) | |
download | linux-d3d6ef1fb908b286a610fe063613e519bc50178b.tar.xz |
usb: host: ohci-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 <yoshihiro.shimoda.uh@renesas.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ohci-platform.c')
-rw-r--r-- | drivers/usb/host/ohci-platform.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/host/ohci-platform.c b/drivers/usb/host/ohci-platform.c index 898b74086c12..6368fce43197 100644 --- a/drivers/usb/host/ohci-platform.c +++ b/drivers/usb/host/ohci-platform.c @@ -183,6 +183,9 @@ static int ohci_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]; } } |