Skip to content

Commit 714dd3c

Browse files
granquetvinodkoul
authored andcommitted
phy: mediatek: hdmi: mt8195: fix uninitialized variable usage in pll_calc
The ret variable in mtk_hdmi_pll_calc() was used unitialized as reported by the kernel test robot. Fix the issue by removing the variable altogether and testing out the return value of mtk_hdmi_pll_set_hw() Fixes: 45810d4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/20230413-fixes-for-mt8195-hdmi-phy-v2-1-bbad62e64321@baylibre.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent a010613 commit 714dd3c

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,
213213
u64 tmds_clk, pixel_clk, da_hdmitx21_ref_ck, ns_hdmipll_ck, pcw;
214214
u8 txpredivs[4] = { 2, 4, 6, 12 };
215215
u32 fbkdiv_low;
216-
int i, ret;
216+
int i;
217217

218218
pixel_clk = rate;
219219
tmds_clk = pixel_clk;
@@ -292,13 +292,9 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,
292292
if (!(digital_div <= 32 && digital_div >= 1))
293293
return -EINVAL;
294294

295-
mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low,
295+
return mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low,
296296
PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv,
297297
txposdiv, digital_div);
298-
if (ret)
299-
return -EINVAL;
300-
301-
return 0;
302298
}
303299

304300
static int mtk_hdmi_pll_drv_setting(struct clk_hw *hw)

0 commit comments

Comments
 (0)