Skip to content

Commit

Permalink
usb: dwc2: fix wrong order of phy_power_on and phy_init
Browse files Browse the repository at this point in the history
Since 1599069 ("phy: core: Warn when phy_power_on is called before
phy_init") the driver complains. In my case (Amlogic SoC) the warning
is: phy phy-fe03e000.phy.2: phy_power_on was called before phy_init
So change the order of the two calls. The same change has to be done
to the order of phy_exit() and phy_power_off().

Fixes: 09a75e8 ("usb: dwc2: refactor common low-level hw code to platform.c")
Cc: [email protected]
Acked-by: Minas Harutyunyan <[email protected]>
Acked-by: Marek Szyprowski <[email protected]>
Signed-off-by: Heiner Kallweit <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
hkallweit authored and gregkh committed Aug 30, 2022
1 parent 8cb339f commit f9b995b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/usb/dwc2/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ static int __dwc2_lowlevel_hw_enable(struct dwc2_hsotg *hsotg)
} else if (hsotg->plat && hsotg->plat->phy_init) {
ret = hsotg->plat->phy_init(pdev, hsotg->plat->phy_type);
} else {
ret = phy_power_on(hsotg->phy);
ret = phy_init(hsotg->phy);
if (ret == 0)
ret = phy_init(hsotg->phy);
ret = phy_power_on(hsotg->phy);
}

return ret;
Expand Down Expand Up @@ -188,9 +188,9 @@ static int __dwc2_lowlevel_hw_disable(struct dwc2_hsotg *hsotg)
} else if (hsotg->plat && hsotg->plat->phy_exit) {
ret = hsotg->plat->phy_exit(pdev, hsotg->plat->phy_type);
} else {
ret = phy_exit(hsotg->phy);
ret = phy_power_off(hsotg->phy);
if (ret == 0)
ret = phy_power_off(hsotg->phy);
ret = phy_exit(hsotg->phy);
}
if (ret)
return ret;
Expand Down

0 comments on commit f9b995b

Please sign in to comment.