Subject: Re: [PATCH net-next v3 03/17] net: ibm: emac: use module_platform_driver for modules

From: kernel test robot <[email-masked]>
Date: Mon, 7 Oct 2024 03:13:07 +0800

Hi Rosen,

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/Rosen-Penev/net-ibm-emac-use-netif_receive_skb_list/20241003-101754
base:   net-next/main
patch link:    https://lore.kernel.org/r/20241003021135.1952928-4-rosenp%40gmail.com
patch subject: [PATCH net-next v3 03/17] net: ibm: emac: use module_platform_driver for modules
config: powerpc-fsp2_defconfig (https://download.01.org/0day-ci/archive/20241007/[email-masked]/config)
compiler: powerpc-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241007/[email-masked]/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 <[email-masked]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email-masked]/

All errors (new ones prefixed by >>):

   powerpc-linux-ld: drivers/net/ethernet/ibm/emac/core.o: in function `emac_init':
>> drivers/net/ethernet/ibm/emac/core.c:3285: multiple definition of `init_module'; drivers/net/ethernet/ibm/emac/mal.o:drivers/net/ethernet/ibm/emac/mal.c:782: first defined here
   powerpc-linux-ld: drivers/net/ethernet/ibm/emac/core.o: in function `emac_exit':
>> drivers/net/ethernet/ibm/emac/core.c:3293: multiple definition of `cleanup_module'; drivers/net/ethernet/ibm/emac/mal.o:drivers/net/ethernet/ibm/emac/mal.c:782: first defined here
   powerpc-linux-ld: drivers/net/ethernet/ibm/emac/rgmii.o: in function `rgmii_driver_init':
   drivers/net/ethernet/ibm/emac/rgmii.c:306: multiple definition of `init_module'; drivers/net/ethernet/ibm/emac/mal.o:drivers/net/ethernet/ibm/emac/mal.c:782: first defined here
   powerpc-linux-ld: drivers/net/ethernet/ibm/emac/rgmii.o: in function `rgmii_driver_exit':
   drivers/net/ethernet/ibm/emac/rgmii.c:306: multiple definition of `cleanup_module'; drivers/net/ethernet/ibm/emac/mal.o:drivers/net/ethernet/ibm/emac/mal.c:782: first defined here

vim +3285 drivers/net/ethernet/ibm/emac/core.c

1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3283  
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3284  static int __init emac_init(void)
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23 @3285  {
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3286  	/* Build EMAC boot list */
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3287  	emac_make_bootlist();
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3288  
c142fce2e67e1b drivers/net/ethernet/ibm/emac/core.c Rosen Penev  2024-10-02  3289  	return platform_driver_register(&emac_driver);
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3290  }
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3291  
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3292  static void __exit emac_exit(void)
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23 @3293  {
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3294  	int i;
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3295  
74888760d40b3a drivers/net/ibm_newemac/core.c       Grant Likely 2011-02-22  3296  	platform_driver_unregister(&emac_driver);
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3297  
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3298  	/* Destroy EMAC boot list */
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3299  	for (i = 0; i < EMAC_BOOT_LIST_SIZE; i++)
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3300  		of_node_put(emac_boot_list[i]);
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3301  }
1d3bb996481e11 drivers/net/ibm_newemac/core.c       David Gibson 2007-08-23  3302  

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