mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-01 06:39:05 +00:00

icssg_prueth.c and icssg_prueth_sr1.c drivers use multiple common .c
files. These common objects are getting added to multiple modules. As a
result when both drivers are enabled in .config, below warning is seen.
drivers/net/ethernet/ti/Makefile: icssg/icssg_common.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_classifier.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_config.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_mii_cfg.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_stats.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
drivers/net/ethernet/ti/Makefile: icssg/icssg_ethtool.o is added to multiple modules: icssg-prueth icssg-prueth-sr1
Fix this by building a new module (icssg.o) for all the common objects.
Both the driver can then depend on this common module.
Some APIs being exported have emac_ as the prefix which may result into
confusion with other existing APIs with emac_ prefix, to avoid
confusion, rename the APIs being exported with emac_ to icssg_ prefix.
This also fixes below error seen when both drivers are built.
ERROR: modpost: "icssg_queue_pop"
[drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
ERROR: modpost: "icssg_queue_push"
[drivers/net/ethernet/ti/icssg-prueth-sr1.ko] undefined!
Reported-and-tested-by: Thorsten Leemhuis <linux@leemhuis.info>
Closes: https://lore.kernel.org/oe-kbuild-all/202405182038.ncf1mL7Z-lkp@intel.com/
Fixes: 487f7323f3
("net: ti: icssg-prueth: Add helper functions to configure FDB")
Reviewed-by: Roger Quadros <rogerq@kernel.org>
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
Reviewed-by: Sai Krishna <saikrishnag@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
49 lines
1.8 KiB
Makefile
49 lines
1.8 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
#
|
|
# Makefile for the TI network device drivers.
|
|
#
|
|
|
|
obj-$(CONFIG_TI_CPSW) += cpsw-common.o
|
|
obj-$(CONFIG_TI_DAVINCI_EMAC) += cpsw-common.o
|
|
obj-$(CONFIG_TI_CPSW_SWITCHDEV) += cpsw-common.o
|
|
|
|
obj-$(CONFIG_TLAN) += tlan.o
|
|
obj-$(CONFIG_TI_DAVINCI_EMAC) += ti_davinci_emac.o
|
|
ti_davinci_emac-y := davinci_emac.o davinci_cpdma.o
|
|
obj-$(CONFIG_TI_DAVINCI_MDIO) += davinci_mdio.o
|
|
obj-$(CONFIG_TI_CPSW_PHY_SEL) += cpsw-phy-sel.o
|
|
obj-$(CONFIG_TI_CPTS) += cpts.o
|
|
obj-$(CONFIG_TI_CPSW) += ti_cpsw.o
|
|
ti_cpsw-y := cpsw.o davinci_cpdma.o cpsw_ale.o cpsw_priv.o cpsw_sl.o cpsw_ethtool.o
|
|
obj-$(CONFIG_TI_CPSW_SWITCHDEV) += ti_cpsw_new.o
|
|
ti_cpsw_new-y := cpsw_switchdev.o cpsw_new.o davinci_cpdma.o cpsw_ale.o cpsw_sl.o cpsw_priv.o cpsw_ethtool.o
|
|
|
|
obj-$(CONFIG_TI_KEYSTONE_NETCP) += keystone_netcp.o
|
|
keystone_netcp-y := netcp_core.o cpsw_ale.o
|
|
obj-$(CONFIG_TI_KEYSTONE_NETCP_ETHSS) += keystone_netcp_ethss.o
|
|
keystone_netcp_ethss-y := netcp_ethss.o netcp_sgmii.o netcp_xgbepcsr.o cpsw_ale.o
|
|
|
|
obj-$(CONFIG_TI_K3_CPPI_DESC_POOL) += k3-cppi-desc-pool.o
|
|
|
|
obj-$(CONFIG_TI_K3_AM65_CPSW_NUSS) += ti-am65-cpsw-nuss.o
|
|
ti-am65-cpsw-nuss-y := am65-cpsw-nuss.o cpsw_sl.o am65-cpsw-ethtool.o cpsw_ale.o
|
|
ti-am65-cpsw-nuss-$(CONFIG_TI_AM65_CPSW_QOS) += am65-cpsw-qos.o
|
|
ti-am65-cpsw-nuss-$(CONFIG_TI_K3_AM65_CPSW_SWITCHDEV) += am65-cpsw-switchdev.o
|
|
obj-$(CONFIG_TI_K3_AM65_CPTS) += am65-cpts.o
|
|
|
|
obj-$(CONFIG_TI_ICSSG_PRUETH) += icssg-prueth.o icssg.o
|
|
icssg-prueth-y := icssg/icssg_prueth.o icssg/icssg_switchdev.o
|
|
|
|
obj-$(CONFIG_TI_ICSSG_PRUETH_SR1) += icssg-prueth-sr1.o icssg.o
|
|
icssg-prueth-sr1-y := icssg/icssg_prueth_sr1.o
|
|
|
|
icssg-y := icssg/icssg_common.o \
|
|
icssg/icssg_classifier.o \
|
|
icssg/icssg_queues.o \
|
|
icssg/icssg_config.o \
|
|
icssg/icssg_mii_cfg.o \
|
|
icssg/icssg_stats.o \
|
|
icssg/icssg_ethtool.o
|
|
|
|
obj-$(CONFIG_TI_ICSS_IEP) += icssg/icss_iep.o
|