Re: [PATCH 4/5] net: stmmac: Add glue layer for Loongson-1 SoC

From: kernel test robot
Date: Sat Aug 12 2023 - 17:31:03 EST


Hi Keguang,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 21ef7b1e17d039053edaeaf41142423810572741]

url: https://github.com/intel-lab-lkp/linux/commits/Keguang-Zhang/MIPS-loongson32-Remove-Loongson1-MAC-arch-code/20230812-231420
base: 21ef7b1e17d039053edaeaf41142423810572741
patch link: https://lore.kernel.org/r/20230812151135.1028780-5-keguang.zhang%40gmail.com
patch subject: [PATCH 4/5] net: stmmac: Add glue layer for Loongson-1 SoC
config: parisc-allyesconfig (https://download.01.org/0day-ci/archive/20230813/202308130554.Rbxxtltt-lkp@xxxxxxxxx/config)
compiler: hppa-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230813/202308130554.Rbxxtltt-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/202308130554.Rbxxtltt-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c: In function 'ls1x_dwmac_probe':
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c:188:21: error: implicit declaration of function 'of_parse_phandle' [-Werror=implicit-function-declaration]
188 | syscon_np = of_parse_phandle(pdev->dev.of_node, "syscon", 0);
| ^~~~~~~~~~~~~~~~
>> drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c:188:19: warning: assignment to 'struct device_node *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
188 | syscon_np = of_parse_phandle(pdev->dev.of_node, "syscon", 0);
| ^
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c:192:17: error: implicit declaration of function 'of_match_node'; did you mean 'for_each_node'? [-Werror=implicit-function-declaration]
192 | match = of_match_node(ls1x_dwmac_syscon_match, syscon_np);
| ^~~~~~~~~~~~~
| for_each_node
>> drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c:192:15: warning: assignment to 'const struct of_device_id *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
192 | match = of_match_node(ls1x_dwmac_syscon_match, syscon_np);
| ^
drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c:194:17: error: implicit declaration of function 'of_node_put'; did you mean 'bpf_module_put'? [-Werror=implicit-function-declaration]
194 | of_node_put(syscon_np);
| ^~~~~~~~~~~
| bpf_module_put
cc1: some warnings being treated as errors


vim +188 drivers/net/ethernet/stmicro/stmmac/dwmac-loongson1.c

170
171 static int ls1x_dwmac_probe(struct platform_device *pdev)
172 {
173 struct plat_stmmacenet_data *plat_dat;
174 struct stmmac_resources stmmac_res;
175 struct device_node *syscon_np;
176 const struct of_device_id *match;
177 struct regmap *regmap;
178 struct ls1x_dwmac *dwmac;
179 const struct ls1x_dwmac_syscon *syscon;
180 size_t size;
181 int ret;
182
183 ret = stmmac_get_platform_resources(pdev, &stmmac_res);
184 if (ret)
185 return ret;
186
187 /* Probe syscon */
> 188 syscon_np = of_parse_phandle(pdev->dev.of_node, "syscon", 0);
189 if (!syscon_np)
190 return -ENODEV;
191
> 192 match = of_match_node(ls1x_dwmac_syscon_match, syscon_np);
193 if (!match) {
194 of_node_put(syscon_np);
195 return -EINVAL;
196 }
197 syscon = (const struct ls1x_dwmac_syscon *)match->data;
198
199 regmap = syscon_node_to_regmap(syscon_np);
200 of_node_put(syscon_np);
201 if (IS_ERR(regmap)) {
202 ret = PTR_ERR(regmap);
203 dev_err(&pdev->dev, "Unable to map syscon: %d\n", ret);
204 return ret;
205 }
206
207 size = syscon->nr_reg_fields * sizeof(struct regmap_field *);
208 dwmac = devm_kzalloc(&pdev->dev, sizeof(*dwmac) + size, GFP_KERNEL);
209 if (!dwmac)
210 return -ENOMEM;
211
212 plat_dat = stmmac_probe_config_dt(pdev, stmmac_res.mac);
213 if (IS_ERR(plat_dat)) {
214 dev_err(&pdev->dev, "dt configuration failed\n");
215 return PTR_ERR(plat_dat);
216 }
217
218 plat_dat->bsp_priv = dwmac;
219 plat_dat->init = ls1x_dwmac_init;
220 dwmac->dev = &pdev->dev;
221 dwmac->plat_dat = plat_dat;
222 dwmac->syscon = syscon;
223 dwmac->regmap = regmap;
224
225 ret = stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
226 if (ret)
227 goto err_remove_config_dt;
228
229 return 0;
230
231 err_remove_config_dt:
232 if (pdev->dev.of_node)
233 stmmac_remove_config_dt(pdev, plat_dat);
234
235 return ret;
236 }
237

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki