phy: rockchip: samsung-hdptx: Do no set rk_hdptx_phy->rate in case of errors
[ Upstream commit 1f4d382769e3b38dfc498c806811dae856e40f31 ]
Ensure rk_hdptx_ropll_tmds_cmn_config() updates hdptx->rate only after
all the other operations have been successful.
Fixes: c4b09c5620 ("phy: phy-rockchip-samsung-hdptx: Add clock provider support")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Link: https://lore.kernel.org/r/20250318-phy-sam-hdptx-bpc-v6-4-8cb1678e7663@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
e3f71127c6
commit
5aac41632f
@@ -781,9 +781,7 @@ static int rk_hdptx_ropll_tmds_cmn_config(struct rk_hdptx_phy *hdptx,
|
|||||||
{
|
{
|
||||||
const struct ropll_config *cfg = NULL;
|
const struct ropll_config *cfg = NULL;
|
||||||
struct ropll_config rc = {0};
|
struct ropll_config rc = {0};
|
||||||
int i;
|
int ret, i;
|
||||||
|
|
||||||
hdptx->rate = rate * 100;
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(ropll_tmds_cfg); i++)
|
for (i = 0; i < ARRAY_SIZE(ropll_tmds_cfg); i++)
|
||||||
if (rate == ropll_tmds_cfg[i].bit_rate) {
|
if (rate == ropll_tmds_cfg[i].bit_rate) {
|
||||||
@@ -842,7 +840,11 @@ static int rk_hdptx_ropll_tmds_cmn_config(struct rk_hdptx_phy *hdptx,
|
|||||||
regmap_update_bits(hdptx->regmap, CMN_REG(0086), PLL_PCG_CLK_EN,
|
regmap_update_bits(hdptx->regmap, CMN_REG(0086), PLL_PCG_CLK_EN,
|
||||||
PLL_PCG_CLK_EN);
|
PLL_PCG_CLK_EN);
|
||||||
|
|
||||||
return rk_hdptx_post_enable_pll(hdptx);
|
ret = rk_hdptx_post_enable_pll(hdptx);
|
||||||
|
if (!ret)
|
||||||
|
hdptx->rate = rate * 100;
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int rk_hdptx_ropll_tmds_mode_config(struct rk_hdptx_phy *hdptx,
|
static int rk_hdptx_ropll_tmds_mode_config(struct rk_hdptx_phy *hdptx,
|
||||||
|
|||||||
Reference in New Issue
Block a user