diff mbox series

[net-next] net: sparx5: add missing lan969x Kconfig dependency

Message ID 20241113115513.4132548-1-arnd@kernel.org (mailing list archive)
State New
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: sparx5: add missing lan969x Kconfig dependency | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 8 of 8 maintainers
netdev/build_clang success Errors and warnings before: 4 this patch: 4
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-11-14--03-00 (tests: 782)

Commit Message

Arnd Bergmann Nov. 13, 2024, 11:55 a.m. UTC
From: Arnd Bergmann <arnd@arndb.de>

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>
---
Side note: given that lan969x is always built as part of sparx5,
wouldn't it make more sense to move all of it into the sparx5
subdirectory?
---
 drivers/net/ethernet/microchip/lan969x/Kconfig  | 2 +-
 drivers/net/ethernet/microchip/lan969x/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Machon Nov. 13, 2024, 7:56 p.m. UTC | #1
Hi Arnd,

> From: Arnd Bergmann <arnd@arndb.de>
> 
> 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.

Checked the different configurations and the change fixed it. Thanks!

> 
> Fixes: 98a01119608d ("net: sparx5: add compatible string for lan969x")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> Side note: given that lan969x is always built as part of sparx5,
> wouldn't it make more sense to move all of it into the sparx5
> subdirectory?
> ---

IDK .. I think I prefer it *not* being hidden under the sparx5 dir. If
we have any guidelines for this, I will gladly comply. :-)

/Daniel

Reviewed-by: Daniel Machon <daniel.machon@microchip.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/microchip/lan969x/Kconfig b/drivers/net/ethernet/microchip/lan969x/Kconfig
index 728180d3fa33..c5c6122ae2ec 100644
--- a/drivers/net/ethernet/microchip/lan969x/Kconfig
+++ b/drivers/net/ethernet/microchip/lan969x/Kconfig
@@ -1,5 +1,5 @@ 
 config LAN969X_SWITCH
-	tristate "Lan969x switch driver"
+	bool "Lan969x switch driver"
 	depends on SPARX5_SWITCH
 	help
 	  This driver supports the lan969x family of network switch devices.
diff --git a/drivers/net/ethernet/microchip/lan969x/Makefile b/drivers/net/ethernet/microchip/lan969x/Makefile
index 9a2351b4f111..316405cbbc71 100644
--- a/drivers/net/ethernet/microchip/lan969x/Makefile
+++ b/drivers/net/ethernet/microchip/lan969x/Makefile
@@ -3,7 +3,7 @@ 
 # Makefile for the Microchip lan969x network device drivers.
 #
 
-obj-$(CONFIG_LAN969X_SWITCH) += lan969x-switch.o
+obj-$(CONFIG_SPARX5_SWITCH) += lan969x-switch.o
 
 lan969x-switch-y := lan969x_regs.o lan969x.o lan969x_calendar.o \
  lan969x_vcap_ag_api.o lan969x_vcap_impl.o