Skip to contentSkip to conversation

net: Make NET imply NETDEVICES

PATCH In review Tom Rini 2 participants 3 messages Nov 9, 2023 – Nov 25, 2023 Networking

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 net: Make NET imply NETDEVICES

Normally, when NET is enabled, CMD_NET will then be enabled and in turn NETDEVICES will (likely) be enabled via imply. However, if we disable CMDLINE in a defconfig we now no longer get CMD_NET enabling NETDEVICES for us. This suggestion (as an imply is) really isn't about the network commands but network itself and is a legacy of how intertwined NET/CMD_NET were historically. Move this over to the NET entry instead where it is a more logical fit.

---
This could also be dropping the imply from cmd/Kconfig and instead making drivers/net/Kconfig::NETDEVICES be default y, which is what it practically is today. This would require a more lengthy check however to be sure there's no functional change and I'm not sure it's any better or worse than this approach.

---
 cmd/Kconfig | 1 -
 net/Kconfig | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)
cmd/Kconfig +0 -1
index 629a90afb7b5..1b4aad5c930b 100644
@@ -1682,7 +1682,6 @@ if NET
 menuconfig CMD_NET
 	bool "Network commands"
 	default y
-	imply NETDEVICES
 
 if CMD_NET
 
net/Kconfig +1 -0
index 4215889127c9..8c80b3a6c671 100644
@@ -5,6 +5,7 @@
 menuconfig NET
 	bool "Networking support"
 	default y
+	imply NETDEVICES
 
 if NET
 
Signature · 1 line
2.34.1
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 17 lines · Tom Rini

Normally, when NET is enabled, CMD_NET will then be enabled and in turn NETDEVICES will (likely) be enabled via imply. However, if we disable CMDLINE in a defconfig we now no longer get CMD_NET enabling NETDEVICES for us. This suggestion (as an imply is) really isn't about the network commands but network itself and is a legacy of how intertwined NET/CMD_NET were historically. Move this over to the NET entry instead where it is a more logical fit.

---
This could also be dropping the imply from cmd/Kconfig and instead making drivers/net/Kconfig::NETDEVICES be default y, which is what it practically is today. This would require a more lengthy check however to be sure there's no functional change and I'm not sure it's any better or worse than this approach.

Quoted 4 lines
---
 cmd/Kconfig | 1 -
 net/Kconfig | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

Thanks!

author
#2 lore raw
In reply to Tom Rini
Quoted 8 lines · Tom Rini

Normally, when NET is enabled, CMD_NET will then be enabled and in turn NETDEVICES will (likely) be enabled via imply. However, if we disable CMDLINE in a defconfig we now no longer get CMD_NET enabling NETDEVICES for us. This suggestion (as an imply is) really isn't about the network commands but network itself and is a legacy of how intertwined NET/CMD_NET were historically. Move this over to the NET entry instead where it is a more logical fit.

Quoted 4 lines

Applied to u-boot/next, thanks!

Signature · 1 line
Tom