Skip to contentSkip to conversation

phy: mediatek/mt8195: fx mtk_hdmi_pll_calc() return code

PATCH In review Arnd Bergmann 2 participants 2 messages Apr 14, 2023 – Apr 18, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: mediatek/mt8195: fx mtk_hdmi_pll_calc() return code

From: Arnd Bergmann <[email protected]>

The newly added function returns an uninitialized variable:

drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]

Wire it up to the return code of the function called just before, assuming that this was the intention originally.

Fixes 45810d486bb4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")
---
 drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +1 -1
index abfc077fb0a8..c8e540665fcb 100644
@@ -292,7 +292,7 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,
 	if (!(digital_div <= 32 && digital_div >= 1))
 		return -EINVAL;
 
-	mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low,
+	ret = mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low,
 			    PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv,
 			    txposdiv, digital_div);
 	if (ret)
Signature · 1 line
2.39.2
maintainer
#1 lore raw

Hi Arnd,

Quoted 20 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

The newly added function returns an uninitialized variable:

drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c:298:6: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]

Wire it up to the return code of the function called just before, assuming that this was the intention originally.

Fixes 45810d486bb4 ("phy: mediatek: add support for phy-mtk-hdmi-mt8195")
---
  drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +0 -0
index abfc077fb0a8..c8e540665fcb 100644

drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw, · line 298

Quoted 8 lines
drivers/phy/mediatek/phy-mtk-hdmi-mt8195.c +1 -1
@@ -292,7 +292,7 @@ static int mtk_hdmi_pll_calc(struct mtk_hdmi_phy *hdmi_phy, struct clk_hw *hw,
  	if (!(digital_div <= 32 && digital_div >= 1))
  		return -EINVAL;
 
-	mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low,
+	ret = mtk_hdmi_pll_set_hw(hw, PLL_PREDIV, fbkdiv_high, fbkdiv_low,
  			    PLL_FBKDIV_HS3, posdiv1, posdiv2, txprediv,
  			    txposdiv, digital_div);
  	if (ret)

I think this is the third patch that fixes this :) Your solution look quite similar to this one:
20230413-fixes-for-mt8195-hdmi-phy-v2-1-bbad62e64321@baylibre.com

Regards,
Mmatthias