[bug report] drm/msm: add msm8998 hdmi phy/pll support

Dan Carpenter dan.carpenter at linaro.org
Tue Sep 3 08:16:18 UTC 2024


Hello Arnaud Vrac,

Commit caedbf17c48d ("drm/msm: add msm8998 hdmi phy/pll support")
from Jul 24, 2024 (linux-next), leads to the following Smatch static
checker warning:

drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c:634 hdmi_8998_pll_prepare() info: return a literal instead of 'ret'
drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c:646 hdmi_8998_pll_prepare() info: return a literal instead of 'ret'

drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c
   620  static int hdmi_8998_pll_prepare(struct clk_hw *hw)
   621  {
   622          struct hdmi_pll_8998 *pll = hw_clk_to_pll(hw);
   623          struct hdmi_phy *phy = pll_get_phy(pll);
   624          int i, ret = 0;
   625  
   626          hdmi_phy_write(phy, REG_HDMI_8998_PHY_CFG, 0x1);
   627          udelay(100);
   628  
   629          hdmi_phy_write(phy, REG_HDMI_8998_PHY_CFG, 0x59);
   630          udelay(100);
   631  
   632          ret = hdmi_8998_pll_lock_status(pll);
   633          if (!ret)
   634                  return ret;

This currently returns success.  Should it return an error code?

   635  
   636          for (i = 0; i < HDMI_NUM_TX_CHANNEL; i++) {
   637                  hdmi_tx_chan_write(pll, i,
   638                                     REG_HDMI_8998_PHY_TXn_LANE_CONFIG, 0x1F);
   639          }
   640  
   641          /* Ensure all registers are flushed to hardware */
   642          wmb();
   643  
   644          ret = hdmi_8998_phy_ready_status(phy);
   645          if (!ret)
   646                  return ret;

Same.

   647  
   648          /* Restart the retiming buffer */
   649          hdmi_phy_write(phy, REG_HDMI_8998_PHY_CFG, 0x58);
   650          udelay(1);
   651          hdmi_phy_write(phy, REG_HDMI_8998_PHY_CFG, 0x59);
   652  
   653          /* Ensure all registers are flushed to hardware */
   654          wmb();
   655  
   656          return 0;
   657  }

regards,
dan carpenter


More information about the dri-devel mailing list