Hi Christian, kernel test robot noticed the following build errors: [auto build test ERROR on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Christian-Marangi/dt-bindings-nvmem-Document-support-for-Airoha-AN8855-Switch-EFUSE/20241208-082533 base: net-next/main patch link: https://lore.kernel.org/r/20241208002105.18074-10-ansuelsmth%40gmail.com patch subject: [net-next PATCH v10 9/9] net: phy: Add Airoha AN8855 Internal Switch Gigabit PHY config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20241208/202412081155.xp97LlzV-lkp@xxxxxxxxx/config) compiler: sh4-linux-gcc (GCC) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241208/202412081155.xp97LlzV-lkp@xxxxxxxxx/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@xxxxxxxxx> | Closes: https://lore.kernel.org/oe-kbuild-all/202412081155.xp97LlzV-lkp@xxxxxxxxx/ All error/warnings (new ones prefixed by >>): drivers/net/phy/air_an8855.c: In function 'an8855_probe': >> drivers/net/phy/air_an8855.c:100:13: warning: unused variable 'ret' [-Wunused-variable] 100 | int ret; | ^~~ drivers/net/phy/air_an8855.c: In function 'an8855_config_init': >> drivers/net/phy/air_an8855.c:154:45: error: 'dev' undeclared (first use in this function); did you mean 'cdev'? 154 | ret = en8855_get_r50ohm_val(dev, "tx_a", &calibration_data[0]); | ^~~ | cdev drivers/net/phy/air_an8855.c:154:45: note: each undeclared identifier is reported only once for each function it appears in vim +154 drivers/net/phy/air_an8855.c 94 95 static int an8855_probe(struct phy_device *phydev) 96 { 97 struct device *dev = &phydev->mdio.dev; 98 struct device_node *node = dev->of_node; 99 struct air_an8855_priv *priv; > 100 int ret; 101 102 /* If we don't have a node, skip calib */ 103 if (!node) 104 return 0; 105 106 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); 107 if (!priv) 108 return -ENOMEM; 109 110 phydev->priv = priv; 111 112 return 0; 113 } 114 115 static int an8855_get_downshift(struct phy_device *phydev, u8 *data) 116 { 117 int val; 118 119 val = phy_read_paged(phydev, AN8855_PHY_PAGE_EXTENDED_1, AN8855_PHY_EXT_REG_14); 120 if (val < 0) 121 return val; 122 123 *data = val & AN8855_PHY_EN_DOWN_SHIFT ? DOWNSHIFT_DEV_DEFAULT_COUNT : 124 DOWNSHIFT_DEV_DISABLE; 125 126 return 0; 127 } 128 129 static int an8855_set_downshift(struct phy_device *phydev, u8 cnt) 130 { 131 u16 ds = cnt != DOWNSHIFT_DEV_DISABLE ? AN8855_PHY_EN_DOWN_SHIFT : 0; 132 133 return phy_modify_paged(phydev, AN8855_PHY_PAGE_EXTENDED_1, 134 AN8855_PHY_EXT_REG_14, AN8855_PHY_EN_DOWN_SHIFT, 135 ds); 136 } 137 138 static int an8855_config_init(struct phy_device *phydev) 139 { 140 struct air_an8855_priv *priv = phydev->priv; 141 int ret; 142 143 /* Enable HW auto downshift */ 144 ret = an8855_set_downshift(phydev, DOWNSHIFT_DEV_DEFAULT_COUNT); 145 if (ret) 146 return ret; 147 148 /* Apply calibration values, if needed. 149 * AN8855_PHY_FLAGS_EN_CALIBRATION signal this. 150 */ 151 if (priv && phydev->dev_flags & AN8855_PHY_FLAGS_EN_CALIBRATION) { 152 u8 *calibration_data = priv->calibration_data; 153 > 154 ret = en8855_get_r50ohm_val(dev, "tx_a", &calibration_data[0]); 155 if (ret) 156 return ret; 157 158 ret = en8855_get_r50ohm_val(dev, "tx_b", &calibration_data[1]); 159 if (ret) 160 return ret; 161 162 ret = en8855_get_r50ohm_val(dev, "tx_c", &calibration_data[2]); 163 if (ret) 164 return ret; 165 166 ret = en8855_get_r50ohm_val(dev, "tx_d", &calibration_data[3]); 167 if (ret) 168 return ret; 169 170 ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, AN8855_PHY_R500HM_RSEL_TX_AB, 171 AN8855_PHY_R50OHM_RSEL_TX_A | AN8855_PHY_R50OHM_RSEL_TX_B, 172 FIELD_PREP(AN8855_PHY_R50OHM_RSEL_TX_A, calibration_data[0]) | 173 FIELD_PREP(AN8855_PHY_R50OHM_RSEL_TX_B, calibration_data[1])); 174 if (ret) 175 return ret; 176 ret = phy_modify_mmd(phydev, MDIO_MMD_VEND1, AN8855_PHY_R500HM_RSEL_TX_CD, 177 AN8855_PHY_R50OHM_RSEL_TX_C | AN8855_PHY_R50OHM_RSEL_TX_D, 178 FIELD_PREP(AN8855_PHY_R50OHM_RSEL_TX_C, calibration_data[2]) | 179 FIELD_PREP(AN8855_PHY_R50OHM_RSEL_TX_D, calibration_data[3])); 180 if (ret) 181 return ret; 182 } 183 184 /* Apply values to reduce signal noise */ 185 ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, AN8855_PHY_TX_PAIR_DLY_SEL_GBE, 186 FIELD_PREP(AN8855_PHY_CR_DA_TX_PAIR_DELKAY_SEL_A_GBE, 0x4) | 187 FIELD_PREP(AN8855_PHY_CR_DA_TX_PAIR_DELKAY_SEL_C_GBE, 0x4)); 188 if (ret) 189 return ret; 190 ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, AN8855_PHY_RXADC_CTRL, 191 AN8855_PHY_RG_AD_SAMNPLE_PHSEL_A | 192 AN8855_PHY_RG_AD_SAMNPLE_PHSEL_C); 193 if (ret) 194 return ret; 195 ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, AN8855_PHY_RXADC_REV_0, 196 FIELD_PREP(AN8855_PHY_RG_AD_RESERVE0_A, 0x1)); 197 if (ret) 198 return ret; 199 ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, AN8855_PHY_RXADC_REV_1, 200 FIELD_PREP(AN8855_PHY_RG_AD_RESERVE0_C, 0x1)); 201 if (ret) 202 return ret; 203 204 return 0; 205 } 206 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki