Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 080de5ba authored by Axel Lin's avatar Axel Lin Committed by Kishon Vijay Abraham I
Browse files

phy: stih41x-usb: Fixup stih41x_usb_phy_power_on failure path



If stih41x_usb_phy_power_on() fails, we need to call clk_disable_unprepare()
before return error. This is to ensure we have balanced clk_enable/disable
calls.

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarPatrice Chotard <patrice.chotard@st.com>
Signed-off-by: default avatarKishon Vijay Abraham I <kishon@ti.com>
parent 739ae345
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -87,8 +87,12 @@ static int stih41x_usb_phy_power_on(struct phy *phy)
		return ret;
		return ret;
	}
	}


	return regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg,
	ret = regmap_update_bits(phy_dev->regmap, phy_dev->cfg->syscfg,
				 phy_dev->cfg->oscok, phy_dev->cfg->oscok);
				 phy_dev->cfg->oscok, phy_dev->cfg->oscok);
	if (ret)
		clk_disable_unprepare(phy_dev->clk);

	return ret;
}
}


static int stih41x_usb_phy_power_off(struct phy *phy)
static int stih41x_usb_phy_power_off(struct phy *phy)