| Message ID | 202303231146312337844@zte.com.cn |
|---|---|
| State | New |
| Headers | show |
| Series | PCI: rockchip: Use dev_err_probe() | expand |
Hi,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on pci/next]
[also build test WARNING on pci/for-linus linus/master v6.3-rc3 next-20230323]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/ye-xingchen-zte-com-cn/PCI-rockchip-Use-dev_err_probe/20230323-114809
base: https://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git next
patch link: https://lore.kernel.org/r/202303231146312337844%40zte.com.cn
patch subject: [PATCH] PCI: rockchip: Use dev_err_probe()
config: ia64-allyesconfig (https://download.01.org/0day-ci/archive/20230323/202303231338.oVZa9IHF-lkp@intel.com/config)
compiler: ia64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/4ad6c26e54b926f384a1bdc99892900cbfa83eea
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review ye-xingchen-zte-com-cn/PCI-rockchip-Use-dev_err_probe/20230323-114809
git checkout 4ad6c26e54b926f384a1bdc99892900cbfa83eea
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=ia64 SHELL=/bin/bash drivers/pci/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303231338.oVZa9IHF-lkp@intel.com/
All warnings (new ones prefixed by >>):
drivers/pci/controller/pcie-rockchip.c: In function 'rockchip_pcie_get_phys':
>> drivers/pci/controller/pcie-rockchip.c:313:74: warning: format '%ld' expects a matching 'long int' argument [-Wformat=]
313 | "missing phy for lane %d: %ld\n", i);
| ~~^
| |
| long int
vim +313 drivers/pci/controller/pcie-rockchip.c
282
283 int rockchip_pcie_get_phys(struct rockchip_pcie *rockchip)
284 {
285 struct device *dev = rockchip->dev;
286 struct phy *phy;
287 char *name;
288 u32 i;
289
290 phy = devm_phy_get(dev, "pcie-phy");
291 if (!IS_ERR(phy)) {
292 rockchip->legacy_phy = true;
293 rockchip->phys[0] = phy;
294 dev_warn(dev, "legacy phy model is deprecated!\n");
295 return 0;
296 }
297
298 if (PTR_ERR(phy) == -EPROBE_DEFER)
299 return PTR_ERR(phy);
300
301 dev_dbg(dev, "missing legacy phy; search for per-lane PHY\n");
302
303 for (i = 0; i < MAX_LANE_NUM; i++) {
304 name = kasprintf(GFP_KERNEL, "pcie-phy-%u", i);
305 if (!name)
306 return -ENOMEM;
307
308 phy = devm_of_phy_get(dev, dev->of_node, name);
309 kfree(name);
310
311 if (IS_ERR(phy))
312 return dev_err_probe(dev, PTR_ERR(phy),
> 313 "missing phy for lane %d: %ld\n", i);
314
315 rockchip->phys[i] = phy;
316 }
317
318 return 0;
319 }
320 EXPORT_SYMBOL_GPL(rockchip_pcie_get_phys);
321
diff --git a/drivers/pci/controller/pcie-rockchip.c b/drivers/pci/controller/pcie-rockchip.c index 990a00e08bc5..e80fde73700c 100644 --- a/drivers/pci/controller/pcie-rockchip.c +++ b/drivers/pci/controller/pcie-rockchip.c @@ -68,54 +68,40 @@ int rockchip_pcie_parse_dt(struct rockchip_pcie *rockchip) rockchip->link_gen = 2; rockchip->core_rst = devm_reset_control_get_exclusive(dev, "core"); - if (IS_ERR(rockchip->core_rst)) { - if (PTR_ERR(rockchip->core_rst) != -EPROBE_DEFER) - dev_err(dev, "missing core reset property in node\n"); - return PTR_ERR(rockchip->core_rst); - } + if (IS_ERR(rockchip->core_rst)) + return dev_err_probe(dev, PTR_ERR(rockchip->core_rst), + "missing core reset property in node\n"); rockchip->mgmt_rst = devm_reset_control_get_exclusive(dev, "mgmt"); - if (IS_ERR(rockchip->mgmt_rst)) { - if (PTR_ERR(rockchip->mgmt_rst) != -EPROBE_DEFER) - dev_err(dev, "missing mgmt reset property in node\n"); - return PTR_ERR(rockchip->mgmt_rst); - } + if (IS_ERR(rockchip->mgmt_rst)) + return dev_err_probe(dev, PTR_ERR(rockchip->mgmt_rst), + "missing mgmt reset property in node\n"); rockchip->mgmt_sticky_rst = devm_reset_control_get_exclusive(dev, "mgmt-sticky"); - if (IS_ERR(rockchip->mgmt_sticky_rst)) { - if (PTR_ERR(rockchip->mgmt_sticky_rst) != -EPROBE_DEFER) - dev_err(dev, "missing mgmt-sticky reset property in node\n"); - return PTR_ERR(rockchip->mgmt_sticky_rst); - } + if (IS_ERR(rockchip->mgmt_sticky_rst)) + return dev_err_probe(dev, PTR_ERR(rockchip->mgmt_sticky_rst), + "missing mgmt-sticky reset property in node\n"); rockchip->pipe_rst = devm_reset_control_get_exclusive(dev, "pipe"); - if (IS_ERR(rockchip->pipe_rst)) { - if (PTR_ERR(rockchip->pipe_rst) != -EPROBE_DEFER) - dev_err(dev, "missing pipe reset property in node\n"); - return PTR_ERR(rockchip->pipe_rst); - } + if (IS_ERR(rockchip->pipe_rst)) + return dev_err_probe(dev, PTR_ERR(rockchip->pipe_rst), + "missing pipe reset property in node\n"); rockchip->pm_rst = devm_reset_control_get_exclusive(dev, "pm"); - if (IS_ERR(rockchip->pm_rst)) { - if (PTR_ERR(rockchip->pm_rst) != -EPROBE_DEFER) - dev_err(dev, "missing pm reset property in node\n"); - return PTR_ERR(rockchip->pm_rst); - } + if (IS_ERR(rockchip->pm_rst)) + return dev_err_probe(dev, PTR_ERR(rockchip->pm_rst), + "missing pm reset property in node\n"); rockchip->pclk_rst = devm_reset_control_get_exclusive(dev, "pclk"); - if (IS_ERR(rockchip->pclk_rst)) { - if (PTR_ERR(rockchip->pclk_rst) != -EPROBE_DEFER) - dev_err(dev, "missing pclk reset property in node\n"); - return PTR_ERR(rockchip->pclk_rst); - } + if (IS_ERR(rockchip->pclk_rst)) + return dev_err_probe(dev, PTR_ERR(rockchip->pclk_rst), + "missing pclk reset property in node\n"); rockchip->aclk_rst = devm_reset_control_get_exclusive(dev, "aclk"); - if (IS_ERR(rockchip->aclk_rst)) { - if (PTR_ERR(rockchip->aclk_rst) != -EPROBE_DEFER) - dev_err(dev, "missing aclk reset property in node\n"); - return PTR_ERR(rockchip->aclk_rst); - } + if (IS_ERR(rockchip->aclk_rst)) + return dev_err_probe(dev, PTR_ERR(rockchip->aclk_rst), + "missing aclk reset property in node\n"); if (rockchip->is_rc) { rockchip->ep_gpio = devm_gpiod_get_optional(dev, "ep", @@ -322,12 +308,9 @@ int rockchip_pcie_get_phys(struct rockchip_pcie *rockchip) phy = devm_of_phy_get(dev, dev->of_node, name); kfree(name); - if (IS_ERR(phy)) { - if (PTR_ERR(phy) != -EPROBE_DEFER) - dev_err(dev, "missing phy for lane %d: %ld\n", - i, PTR_ERR(phy)); - return PTR_ERR(phy); - } + if (IS_ERR(phy)) + return dev_err_probe(dev, PTR_ERR(phy), + "missing phy for lane %d: %ld\n", i); rockchip->phys[i] = phy; }