Netdev List
 help / color / mirror / Atom feed
* [PATCH net] net: enetc: fix the netc-lib driver build dependency
@ 2025-06-03 10:50 Wei Fang
  2025-06-03 20:45 ` Vladimir Oltean
  0 siblings, 1 reply; 7+ messages in thread
From: Wei Fang @ 2025-06-03 10:50 UTC (permalink / raw)
  To: claudiu.manoil, vladimir.oltean, xiaoning.wang, andrew+netdev,
	davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, imx, arnd

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 take into
account that the netc-lib driver needs to support being compiled as a
loadable module. So we can solve this issue and support "tristate" by
setting the default value.

Reported-by: Arnd Bergmann <arnd@kernel.org>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505220734.x6TF6oHR-lkp@intel.com/
Fixes: 4701073c3deb ("net: enetc: add initial netc-lib driver to support NTMP")
Signed-off-by: Wei Fang <wei.fang@nxp.com>
---
Arnd Bergmann has posted a similar patch [1], but it has not been updated
since the first version, perhaps he is busy with more important things.
In order to fix the issue ASAP, I made this patch. And I added the
Reported-by tag to give credit to Arnd Bergmann.
[1] https://lore.kernel.org/imx/20250520161218.3581272-1-arnd@kernel.org/
---
 drivers/net/ethernet/freescale/enetc/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/freescale/enetc/Kconfig b/drivers/net/ethernet/freescale/enetc/Kconfig
index e917132d3714..06759bedb193 100644
--- a/drivers/net/ethernet/freescale/enetc/Kconfig
+++ b/drivers/net/ethernet/freescale/enetc/Kconfig
@@ -17,6 +17,7 @@ config NXP_ENETC_PF_COMMON
 
 config NXP_NETC_LIB
 	tristate
+	default y if FSL_ENETC_CORE=y && NXP_ENETC4=m
 	help
 	  This module provides common functionalities for both ENETC and NETC
 	  Switch, such as NETC Table Management Protocol (NTMP) 2.0, common tc
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-06-04 11:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-03 10:50 [PATCH net] net: enetc: fix the netc-lib driver build dependency Wei Fang
2025-06-03 20:45 ` Vladimir Oltean
2025-06-04  2:44   ` Wei Fang
2025-06-04  7:24     ` Arnd Bergmann
2025-06-04  9:11       ` Vladimir Oltean
2025-06-04  9:30         ` Arnd Bergmann
2025-06-04 11:32           ` Wei Fang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox