aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/ehci-orion.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2019-01-29 10:23:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-01-30 09:22:35 +0100
commite04585184dcf792cd053d6ce84091201e45c2225 (patch)
tree7b10ab2d6147151b6ecd460c6d9c48049e7459e9 /drivers/usb/host/ehci-orion.c
parentusb: host: xhci: mvebu: add reset on resume quirk (diff)
downloadlinux-dev-e04585184dcf792cd053d6ce84091201e45c2225.tar.xz
linux-dev-e04585184dcf792cd053d6ce84091201e45c2225.zip
usb: ehci-orion: avoid double PHY initialization
No need to initialize the PHY from the driver's probe. It is done by the core automatically and doing it twice would increment the phy->powercount counter to 2 instead of 1. During later suspend operation, the counter will be decremented to one, no phy->power_off() will occur and worse than that, the following phy->power_on() at resume time will also be skipped, failing the whole S2RAM operation. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/ehci-orion.c')
-rw-r--r--drivers/usb/host/ehci-orion.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/usb/host/ehci-orion.c b/drivers/usb/host/ehci-orion.c
index 1ad72647a069..3109f082949e 100644
--- a/drivers/usb/host/ehci-orion.c
+++ b/drivers/usb/host/ehci-orion.c
@@ -257,15 +257,7 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
if (IS_ERR(priv->phy)) {
err = PTR_ERR(priv->phy);
if (err != -ENOSYS)
- goto err_phy_get;
- } else {
- err = phy_init(priv->phy);
- if (err)
- goto err_phy_init;
-
- err = phy_power_on(priv->phy);
- if (err)
- goto err_phy_power_on;
+ goto err_dis_clk;
}
/*
@@ -297,19 +289,12 @@ static int ehci_orion_drv_probe(struct platform_device *pdev)
err = usb_add_hcd(hcd, irq, IRQF_SHARED);
if (err)
- goto err_add_hcd;
+ goto err_dis_clk;
device_wakeup_enable(hcd->self.controller);
return 0;
-err_add_hcd:
- if (!IS_ERR(priv->phy))
- phy_power_off(priv->phy);
-err_phy_power_on:
- if (!IS_ERR(priv->phy))
- phy_exit(priv->phy);
-err_phy_init:
-err_phy_get:
+err_dis_clk:
if (!IS_ERR(priv->clk))
clk_disable_unprepare(priv->clk);
usb_put_hcd(hcd);
@@ -327,11 +312,6 @@ static int ehci_orion_drv_remove(struct platform_device *pdev)
usb_remove_hcd(hcd);
- if (!IS_ERR(priv->phy)) {
- phy_power_off(priv->phy);
- phy_exit(priv->phy);
- }
-
if (!IS_ERR(priv->clk))
clk_disable_unprepare(priv->clk);