[linux-next:master 1921/2594] drivers/net/ethernet/ti/davinci_mdio.c:649: undefined reference to `free_mdio_bitbang'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   05477f3653b82d8b3bcf39d2937d9893124976db
commit: d04807b80691c6041ca8e3dcf1870d1bf1082c22 [1921/2594] net: ethernet: ti: davinci_mdio: Add workaround for errata i2329
config: arm-omap2plus_defconfig (https://download.01.org/0day-ci/archive/20220824/202208240807.91DnMomx-lkp@xxxxxxxxx/config)
compiler: arm-linux-gnueabi-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://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=d04807b80691c6041ca8e3dcf1870d1bf1082c22
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout d04807b80691c6041ca8e3dcf1870d1bf1082c22
        # 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=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   arm-linux-gnueabi-ld: drivers/net/ethernet/ti/davinci_mdio.o: in function `davinci_mdio_remove':
>> drivers/net/ethernet/ti/davinci_mdio.c:649: undefined reference to `free_mdio_bitbang'
   arm-linux-gnueabi-ld: drivers/net/ethernet/ti/davinci_mdio.o: in function `davinci_mdio_probe':
>> drivers/net/ethernet/ti/davinci_mdio.c:545: undefined reference to `alloc_mdio_bitbang'
   arm-linux-gnueabi-ld: drivers/net/ethernet/ti/davinci_mdio.o: in function `davinci_mdiobb_read':
>> drivers/net/ethernet/ti/davinci_mdio.c:236: undefined reference to `mdiobb_read'
   arm-linux-gnueabi-ld: drivers/net/ethernet/ti/davinci_mdio.o: in function `davinci_mdiobb_write':
>> drivers/net/ethernet/ti/davinci_mdio.c:253: undefined reference to `mdiobb_write'


vim +649 drivers/net/ethernet/ti/davinci_mdio.c

   514	
   515	static int davinci_mdio_probe(struct platform_device *pdev)
   516	{
   517		struct mdio_platform_data *pdata = dev_get_platdata(&pdev->dev);
   518		struct device *dev = &pdev->dev;
   519		struct davinci_mdio_data *data;
   520		struct resource *res;
   521		struct phy_device *phy;
   522		int ret, addr;
   523		int autosuspend_delay_ms = -1;
   524	
   525		data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
   526		if (!data)
   527			return -ENOMEM;
   528	
   529		data->manual_mode = false;
   530		data->bb_ctrl.ops = &davinci_mdiobb_ops;
   531	
   532		if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
   533			const struct soc_device_attribute *soc_match_data;
   534	
   535			soc_match_data = soc_device_match(k3_mdio_socinfo);
   536			if (soc_match_data && soc_match_data->data) {
   537				const struct k3_mdio_soc_data *socdata =
   538							soc_match_data->data;
   539	
   540				data->manual_mode = socdata->manual_mode;
   541			}
   542		}
   543	
   544		if (data->manual_mode)
 > 545			data->bus = alloc_mdio_bitbang(&data->bb_ctrl);
   546		else
   547			data->bus = devm_mdiobus_alloc(dev);
   548	
   549		if (!data->bus) {
   550			dev_err(dev, "failed to alloc mii bus\n");
   551			return -ENOMEM;
   552		}
   553	
   554		if (IS_ENABLED(CONFIG_OF) && dev->of_node) {
   555			const struct davinci_mdio_of_param *of_mdio_data;
   556	
   557			ret = davinci_mdio_probe_dt(&data->pdata, pdev);
   558			if (ret)
   559				return ret;
   560			snprintf(data->bus->id, MII_BUS_ID_SIZE, "%s", pdev->name);
   561	
   562			of_mdio_data = of_device_get_match_data(&pdev->dev);
   563			if (of_mdio_data) {
   564				autosuspend_delay_ms =
   565						of_mdio_data->autosuspend_delay_ms;
   566			}
   567		} else {
   568			data->pdata = pdata ? (*pdata) : default_pdata;
   569			snprintf(data->bus->id, MII_BUS_ID_SIZE, "%s-%x",
   570				 pdev->name, pdev->id);
   571		}
   572	
   573		data->bus->name		= dev_name(dev);
   574	
   575		if (data->manual_mode) {
   576			data->bus->read		= davinci_mdiobb_read;
   577			data->bus->write	= davinci_mdiobb_write;
   578			data->bus->reset	= davinci_mdiobb_reset;
   579	
   580			dev_info(dev, "Configuring MDIO in manual mode\n");
   581		} else {
   582			data->bus->read		= davinci_mdio_read;
   583			data->bus->write	= davinci_mdio_write;
   584			data->bus->reset	= davinci_mdio_reset;
   585			data->bus->priv		= data;
   586		}
   587		data->bus->parent	= dev;
   588	
   589		data->clk = devm_clk_get(dev, "fck");
   590		if (IS_ERR(data->clk)) {
   591			dev_err(dev, "failed to get device clock\n");
   592			return PTR_ERR(data->clk);
   593		}
   594	
   595		dev_set_drvdata(dev, data);
   596		data->dev = dev;
   597	
   598		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   599		if (!res)
   600			return -EINVAL;
   601		data->regs = devm_ioremap(dev, res->start, resource_size(res));
   602		if (!data->regs)
   603			return -ENOMEM;
   604	
   605		davinci_mdio_init_clk(data);
   606	
   607		pm_runtime_set_autosuspend_delay(&pdev->dev, autosuspend_delay_ms);
   608		pm_runtime_use_autosuspend(&pdev->dev);
   609		pm_runtime_enable(&pdev->dev);
   610	
   611		/* register the mii bus
   612		 * Create PHYs from DT only in case if PHY child nodes are explicitly
   613		 * defined to support backward compatibility with DTs which assume that
   614		 * Davinci MDIO will always scan the bus for PHYs detection.
   615		 */
   616		if (dev->of_node && of_get_child_count(dev->of_node))
   617			data->skip_scan = true;
   618	
   619		ret = of_mdiobus_register(data->bus, dev->of_node);
   620		if (ret)
   621			goto bail_out;
   622	
   623		/* scan and dump the bus */
   624		for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
   625			phy = mdiobus_get_phy(data->bus, addr);
   626			if (phy) {
   627				dev_info(dev, "phy[%d]: device %s, driver %s\n",
   628					 phy->mdio.addr, phydev_name(phy),
   629					 phy->drv ? phy->drv->name : "unknown");
   630			}
   631		}
   632	
   633		return 0;
   634	
   635	bail_out:
   636		pm_runtime_dont_use_autosuspend(&pdev->dev);
   637		pm_runtime_disable(&pdev->dev);
   638		return ret;
   639	}
   640	
   641	static int davinci_mdio_remove(struct platform_device *pdev)
   642	{
   643		struct davinci_mdio_data *data = platform_get_drvdata(pdev);
   644	
   645		if (data->bus) {
   646			mdiobus_unregister(data->bus);
   647	
   648			if (data->manual_mode)
 > 649				free_mdio_bitbang(data->bus);
   650		}
   651	
   652		pm_runtime_dont_use_autosuspend(&pdev->dev);
   653		pm_runtime_disable(&pdev->dev);
   654	
   655		return 0;
   656	}
   657	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux