Re: [PATCH v3 2/5] phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY

From: kernel test robot
Date: Wed Jun 07 2023 - 07:28:56 EST


Hi Stanley,

kernel test robot noticed the following build errors:

[auto build test ERROR on usb/usb-testing]
[also build test ERROR on usb/usb-next usb/usb-linus robh/for-next linus/master v6.4-rc5 next-20230607]
[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/Stanley-Chang/phy-realtek-usb-Add-driver-for-the-Realtek-SoC-USB-2-0-PHY/20230607-142704
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link: https://lore.kernel.org/r/20230607062500.24669-2-stanley_chang%40realtek.com
patch subject: [PATCH v3 2/5] phy: realtek: usb: Add driver for the Realtek SoC USB 2.0 PHY
config: sh-randconfig-r033-20230607 (https://download.01.org/0day-ci/archive/20230607/202306071901.mhcH1Kcc-lkp@xxxxxxxxx/config)
compiler: sh4-linux-gcc (GCC) 12.3.0
reproduce (this is a W=1 build):
mkdir -p ~/bin
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add usb https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
git fetch usb usb-testing
git checkout usb/usb-testing
b4 shazam https://lore.kernel.org/r/20230607062500.24669-2-stanley_chang@xxxxxxxxxxx
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir --shuffle=2827500481 ARCH=sh olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.3.0 ~/bin/make.cross W=1 O=build_dir --shuffle=2827500481 ARCH=sh SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306071901.mhcH1Kcc-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

sh4-linux-ld: drivers/phy/realtek/phy-rtk-usb2.o: in function `rtk_usb2phy_remove':
>> drivers/phy/realtek/phy-rtk-usb2.c:1891: undefined reference to `usb_remove_phy'
sh4-linux-ld: drivers/phy/realtek/phy-rtk-usb2.o: in function `create_debug_files':
>> drivers/phy/realtek/phy-rtk-usb2.c:1378: undefined reference to `usb_debug_root'
sh4-linux-ld: drivers/phy/realtek/phy-rtk-usb2.o: in function `rtk_usb2phy_probe':
>> drivers/phy/realtek/phy-rtk-usb2.c:1882: undefined reference to `usb_add_phy_dev'
sh4-linux-ld: drivers/power/supply/wm831x_power.o: in function `wm831x_power_probe':
>> drivers/power/supply/wm831x_power.c:695: undefined reference to `devm_usb_get_phy_by_phandle'
sh4-linux-ld: drivers/power/supply/rt9455_charger.o: in function `rt9455_probe':
>> drivers/power/supply/rt9455_charger.c:1682: undefined reference to `devm_usb_get_phy'
sh4-linux-ld: drivers/power/supply/isp1704_charger.o: in function `isp1704_charger_probe':
>> drivers/power/supply/isp1704_charger.c:73: undefined reference to `devm_usb_get_phy_by_phandle'
>> sh4-linux-ld: drivers/power/supply/isp1704_charger.c:73: undefined reference to `devm_usb_get_phy'
sh4-linux-ld: drivers/power/supply/bq25890_charger.o: in function `bq25890_probe':
>> drivers/power/supply/bq25890_charger.c:1511: undefined reference to `devm_usb_get_phy'
sh4-linux-ld: drivers/power/supply/bq256xx_charger.o: in function `bq256xx_probe':
>> drivers/power/supply/bq256xx_charger.c:1743: undefined reference to `devm_usb_get_phy'

Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for USB_PHY
Depends on [n]: USB_SUPPORT [=n]
Selected by [y]:
- PHY_RTK_RTD_USB2PHY [=y]


vim +1891 drivers/phy/realtek/phy-rtk-usb2.c

1802
1803 static int rtk_usb2phy_probe(struct platform_device *pdev)
1804 {
1805 struct rtk_usb_phy *rtk_phy;
1806 struct device *dev = &pdev->dev;
1807 struct device_node *node;
1808 struct device_node *sub_node;
1809 struct phy *generic_phy;
1810 struct phy_provider *phy_provider;
1811 int phyN, ret = 0;
1812
1813 rtk_phy = devm_kzalloc(dev, sizeof(*rtk_phy), GFP_KERNEL);
1814 if (!rtk_phy)
1815 return -ENOMEM;
1816
1817 rtk_phy->dev = &pdev->dev;
1818 rtk_phy->phy.dev = rtk_phy->dev;
1819 rtk_phy->phy.label = "rtk-usb2phy";
1820 rtk_phy->phy.notify_port_status = rtk_usb_phy_notify_port_status;
1821
1822 if (!dev->of_node) {
1823 dev_err(dev, "%s %d No device node\n", __func__, __LINE__);
1824 goto err;
1825 }
1826
1827 node = dev->of_node;
1828
1829 rtk_phy->usb_ctrl_regs = syscon_regmap_lookup_by_phandle(node, "realtek,usb-ctrl");
1830 if (IS_ERR(rtk_phy->usb_ctrl_regs)) {
1831 dev_info(dev, "%s: DTS no support usb_ctrl regs syscon\n", __func__);
1832 rtk_phy->usb_ctrl_regs = NULL;
1833 }
1834
1835 phyN = of_get_child_count(node);
1836 rtk_phy->phyN = phyN;
1837 dev_dbg(dev, "%s phyN=%d\n", __func__, rtk_phy->phyN);
1838
1839 rtk_phy->reg_addr = devm_kzalloc(dev,
1840 sizeof(struct reg_addr) * phyN, GFP_KERNEL);
1841 if (!rtk_phy->reg_addr)
1842 return -ENOMEM;
1843
1844 rtk_phy->phy_data = devm_kzalloc(dev,
1845 sizeof(struct phy_data) * phyN, GFP_KERNEL);
1846 if (!rtk_phy->phy_data)
1847 return -ENOMEM;
1848
1849 for (sub_node = of_get_next_child(node, NULL); sub_node != NULL;
1850 sub_node = of_get_next_child(node, sub_node)) {
1851 ret = get_phy_parameter(rtk_phy, sub_node);
1852 if (ret) {
1853 dev_err(dev, "%s: get_phy_parameter fail ret=%d\n",
1854 __func__, ret);
1855 goto err;
1856 }
1857 }
1858
1859 platform_set_drvdata(pdev, rtk_phy);
1860
1861 generic_phy = devm_phy_create(rtk_phy->dev, NULL, &ops);
1862 if (IS_ERR(generic_phy))
1863 return PTR_ERR(generic_phy);
1864
1865 phy_set_drvdata(generic_phy, rtk_phy);
1866
1867 phy_provider = devm_of_phy_provider_register(rtk_phy->dev,
1868 of_phy_simple_xlate);
1869 if (IS_ERR(phy_provider))
1870 return PTR_ERR(phy_provider);
1871
1872 ret = usb_add_phy_dev(&rtk_phy->phy);
1873 if (ret)
1874 goto err;
1875
1876 create_debug_files(rtk_phy);
1877
1878 err:
1879 dev_dbg(dev, "Probe RTK USB 2.0 PHY (ret=%d)\n", ret);
1880
1881 return ret;
> 1882 }
1883
1884 static void rtk_usb2phy_remove(struct platform_device *pdev)
1885 {
1886 struct rtk_usb_phy *rtk_phy = platform_get_drvdata(pdev);
1887
1888 remove_debug_files(rtk_phy);
1889
1890 usb_remove_phy(&rtk_phy->phy);
> 1891 }
1892

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