phy: rockchip: inno-usb2: only disable usb480m clk in error path

This fix the usb480m clk disable error when phy power on.

Fixes: daf2796321 ("Merge commit '52f971ee6e023d89d24f9e3cd145d86d707e459c'")
Signed-off-by: Frank Wang <frank.wang@rock-chips.com>
Change-Id: I79f84757cccdca56357794d3bb5bfdc8df6c0a1f
This commit is contained in:
Frank Wang
2023-05-24 10:13:22 +08:00
committed by Tao Huang
parent 2585198687
commit 640eb99d42

View File

@@ -886,8 +886,10 @@ static int rockchip_usb2phy_power_on(struct phy *phy)
goto unlock;
ret = property_enable(base, &rport->port_cfg->phy_sus, false);
if (ret)
goto disable_clks;
if (ret) {
clk_disable_unprepare(rphy->clk480m);
goto unlock;
}
/*
* For rk3588, it needs to reset phy when exit from
@@ -900,8 +902,10 @@ static int rockchip_usb2phy_power_on(struct phy *phy)
if (rport->port_id == USB2PHY_PORT_OTG &&
of_device_is_compatible(rphy->dev->of_node, "rockchip,rk3588-usb2phy")) {
ret = rockchip_usb2phy_reset(rphy);
if (ret)
goto disable_clks;
if (ret) {
clk_disable_unprepare(rphy->clk480m);
goto unlock;
}
}
/* waiting for the utmi_clk to become stable */
@@ -909,9 +913,6 @@ static int rockchip_usb2phy_power_on(struct phy *phy)
rport->suspended = false;
disable_clks:
clk_disable_unprepare(rphy->clk480m);
unlock:
mutex_unlock(&rport->mutex);