Commit 82cbd06f authored by Wei Fang's avatar Wei Fang Committed by David S. Miller
Browse files

net: enetc: fix the netc-lib driver build dependency



The kernel robot reported the following errors when the netc-lib driver
was compiled as a loadable module and the enetc-core driver was built-in.

ld.lld: error: undefined symbol: ntmp_init_cbdr
referenced by enetc_cbdr.c:88 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:88)
ld.lld: error: undefined symbol: ntmp_free_cbdr
referenced by enetc_cbdr.c:96 (drivers/net/ethernet/freescale/enetc/enetc_cbdr.c:96)

Simply changing "tristate" to "bool" can fix this issue, but considering
that the netc-lib driver needs to support being compiled as a loadable
module and LS1028 does not need the netc-lib driver. Therefore, we add a
boolean symbol 'NXP_NTMP' to enable 'NXP_NETC_LIB' as needed. And when
adding NETC switch driver support in the future, there is no need to
modify the dependency, just select "NXP_NTMP" and "NXP_NETC_LIB" at the
same time.

Reported-by: default avatarArnd Bergmann <arnd@kernel.org>
Reported-by: default avatarkernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505220734.x6TF6oHR-lkp@intel.com/


Fixes: 4701073c ("net: enetc: add initial netc-lib driver to support NTMP")
Suggested-by: default avatarArnd Bergmann <arnd@kernel.org>
Signed-off-by: default avatarWei Fang <wei.fang@nxp.com>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 87f7ce26
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
# SPDX-License-Identifier: GPL-2.0
config FSL_ENETC_CORE
	tristate
	select NXP_NETC_LIB if NXP_NTMP
	help
	  This module supports common functionality between the PF and VF
	  drivers for the NXP ENETC controller.
@@ -22,6 +23,9 @@ config NXP_NETC_LIB
	  Switch, such as NETC Table Management Protocol (NTMP) 2.0, common tc
	  flower and debugfs interfaces and so on.

config NXP_NTMP
	bool

config FSL_ENETC
	tristate "ENETC PF driver"
	depends on PCI_MSI
@@ -45,7 +49,7 @@ config NXP_ENETC4
	select FSL_ENETC_CORE
	select FSL_ENETC_MDIO
	select NXP_ENETC_PF_COMMON
	select NXP_NETC_LIB
	select NXP_NTMP
	select PHYLINK
	select DIMLIB
	help