Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: sparx5: add missing lan969x Kconfig dependency

The sparx5 switchdev driver can be built either with or without support
for the Lan969x switch. However, it cannot be built-in when the lan969x
driver is a loadable module because of a link-time dependency:

arm-linux-gnueabi-ld: drivers/net/ethernet/microchip/sparx5/sparx5_main.o:(.rodata+0xd44): undefined reference to `lan969x_desc'

Add a Kconfig dependency to reflect this in Kconfig, allowing all
the valid configurations but forcing sparx5 to be a loadable module
as well if lan969x is.

Fixes: 98a01119608d ("net: sparx5: add compatible string for lan969x")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
Link: https://patch.msgid.link/20241113115513.4132548-1-arnd@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Arnd Bergmann and committed by
Jakub Kicinski
4c54e949 f66af961

+2 -2
+1 -1
drivers/net/ethernet/microchip/lan969x/Kconfig
··· 1 1 config LAN969X_SWITCH 2 - tristate "Lan969x switch driver" 2 + bool "Lan969x switch driver" 3 3 depends on SPARX5_SWITCH 4 4 help 5 5 This driver supports the lan969x family of network switch devices.
+1 -1
drivers/net/ethernet/microchip/lan969x/Makefile
··· 3 3 # Makefile for the Microchip lan969x network device drivers. 4 4 # 5 5 6 - obj-$(CONFIG_LAN969X_SWITCH) += lan969x-switch.o 6 + obj-$(CONFIG_SPARX5_SWITCH) += lan969x-switch.o 7 7 8 8 lan969x-switch-y := lan969x_regs.o lan969x.o lan969x_calendar.o \ 9 9 lan969x_vcap_ag_api.o lan969x_vcap_impl.o