Commit 227d7206 authored by Alexander Lobakin's avatar Alexander Lobakin Committed by David S. Miller

dsa: simplify Kconfig symbols and dependencies

1. Remove CONFIG_HAVE_NET_DSA.

CONFIG_HAVE_NET_DSA is a legacy leftover from the times when drivers
should have selected CONFIG_NET_DSA manually.
Currently, all drivers has explicit 'depends on NET_DSA', so this is
no more needed.

2. CONFIG_HAVE_NET_DSA dependencies became CONFIG_NET_DSA's ones.

 - dropped !S390 dependency which was introduced to be sure NET_DSA
   can select CONFIG_PHYLIB. DSA migrated to Phylink almost 3 years
   ago and the PHY library itself doesn't depend on !S390 since
   commit 870a2b5e ("phylib: remove !S390 dependeny from Kconfig");
 - INET dependency is kept to be sure we can select NET_SWITCHDEV;
 - NETDEVICES dependency is kept to be sure we can select PHYLINK.

3. DSA drivers menu now depends on NET_DSA.

Instead on 'depends on NET_DSA' on every single driver, the entire
menu now depends on it. This eliminates a lot of duplicated lines
from Kconfig with no loss (when CONFIG_NET_DSA=m, drivers also can
be only m or n).
This also has a nice side effect that there's no more empty menu on
configurations without DSA.

4. Kbuild will now descend into 'drivers/net/dsa' only when
   CONFIG_NET_DSA is y or m.

This is safe since no objects inside this folder can be built without
DSA core, as well as when CONFIG_NET_DSA=m, no objects can be
built-in.
Signed-off-by: default avatarAlexander Lobakin <alobakin@pm.me>
Reviewed-by: default avatarVladimir Oltean <olteanv@gmail.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a1e6f641
...@@ -45,7 +45,7 @@ obj-$(CONFIG_ARCNET) += arcnet/ ...@@ -45,7 +45,7 @@ obj-$(CONFIG_ARCNET) += arcnet/
obj-$(CONFIG_DEV_APPLETALK) += appletalk/ obj-$(CONFIG_DEV_APPLETALK) += appletalk/
obj-$(CONFIG_CAIF) += caif/ obj-$(CONFIG_CAIF) += caif/
obj-$(CONFIG_CAN) += can/ obj-$(CONFIG_CAN) += can/
obj-y += dsa/ obj-$(CONFIG_NET_DSA) += dsa/
obj-$(CONFIG_ETHERNET) += ethernet/ obj-$(CONFIG_ETHERNET) += ethernet/
obj-$(CONFIG_FDDI) += fddi/ obj-$(CONFIG_FDDI) += fddi/
obj-$(CONFIG_HIPPI) += hippi/ obj-$(CONFIG_HIPPI) += hippi/
......
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
menu "Distributed Switch Architecture drivers" menu "Distributed Switch Architecture drivers"
depends on HAVE_NET_DSA depends on NET_DSA
source "drivers/net/dsa/b53/Kconfig" source "drivers/net/dsa/b53/Kconfig"
config NET_DSA_BCM_SF2 config NET_DSA_BCM_SF2
tristate "Broadcom Starfighter 2 Ethernet switch support" tristate "Broadcom Starfighter 2 Ethernet switch support"
depends on HAS_IOMEM && NET_DSA depends on HAS_IOMEM
select NET_DSA_TAG_BRCM select NET_DSA_TAG_BRCM
select FIXED_PHY select FIXED_PHY
select BCM7XXX_PHY select BCM7XXX_PHY
...@@ -18,7 +18,6 @@ config NET_DSA_BCM_SF2 ...@@ -18,7 +18,6 @@ config NET_DSA_BCM_SF2
config NET_DSA_LOOP config NET_DSA_LOOP
tristate "DSA mock-up Ethernet switch chip support" tristate "DSA mock-up Ethernet switch chip support"
depends on NET_DSA
select FIXED_PHY select FIXED_PHY
help help
This enables support for a fake mock-up switch chip which This enables support for a fake mock-up switch chip which
...@@ -28,7 +27,7 @@ source "drivers/net/dsa/hirschmann/Kconfig" ...@@ -28,7 +27,7 @@ source "drivers/net/dsa/hirschmann/Kconfig"
config NET_DSA_LANTIQ_GSWIP config NET_DSA_LANTIQ_GSWIP
tristate "Lantiq / Intel GSWIP" tristate "Lantiq / Intel GSWIP"
depends on HAS_IOMEM && NET_DSA depends on HAS_IOMEM
select NET_DSA_TAG_GSWIP select NET_DSA_TAG_GSWIP
help help
This enables support for the Lantiq / Intel GSWIP 2.1 found in This enables support for the Lantiq / Intel GSWIP 2.1 found in
...@@ -36,7 +35,6 @@ config NET_DSA_LANTIQ_GSWIP ...@@ -36,7 +35,6 @@ config NET_DSA_LANTIQ_GSWIP
config NET_DSA_MT7530 config NET_DSA_MT7530
tristate "MediaTek MT753x and MT7621 Ethernet switch support" tristate "MediaTek MT753x and MT7621 Ethernet switch support"
depends on NET_DSA
select NET_DSA_TAG_MTK select NET_DSA_TAG_MTK
help help
This enables support for the MediaTek MT7530, MT7531, and MT7621 This enables support for the MediaTek MT7530, MT7531, and MT7621
...@@ -44,7 +42,6 @@ config NET_DSA_MT7530 ...@@ -44,7 +42,6 @@ config NET_DSA_MT7530
config NET_DSA_MV88E6060 config NET_DSA_MV88E6060
tristate "Marvell 88E6060 ethernet switch chip support" tristate "Marvell 88E6060 ethernet switch chip support"
depends on NET_DSA
select NET_DSA_TAG_TRAILER select NET_DSA_TAG_TRAILER
help help
This enables support for the Marvell 88E6060 ethernet switch This enables support for the Marvell 88E6060 ethernet switch
...@@ -64,7 +61,6 @@ source "drivers/net/dsa/xrs700x/Kconfig" ...@@ -64,7 +61,6 @@ source "drivers/net/dsa/xrs700x/Kconfig"
config NET_DSA_QCA8K config NET_DSA_QCA8K
tristate "Qualcomm Atheros QCA8K Ethernet switch family support" tristate "Qualcomm Atheros QCA8K Ethernet switch family support"
depends on NET_DSA
select NET_DSA_TAG_QCA select NET_DSA_TAG_QCA
select REGMAP select REGMAP
help help
...@@ -73,7 +69,6 @@ config NET_DSA_QCA8K ...@@ -73,7 +69,6 @@ config NET_DSA_QCA8K
config NET_DSA_REALTEK_SMI config NET_DSA_REALTEK_SMI
tristate "Realtek SMI Ethernet switch family support" tristate "Realtek SMI Ethernet switch family support"
depends on NET_DSA
select NET_DSA_TAG_RTL4_A select NET_DSA_TAG_RTL4_A
select FIXED_PHY select FIXED_PHY
select IRQ_DOMAIN select IRQ_DOMAIN
...@@ -93,7 +88,7 @@ config NET_DSA_SMSC_LAN9303 ...@@ -93,7 +88,7 @@ config NET_DSA_SMSC_LAN9303
config NET_DSA_SMSC_LAN9303_I2C config NET_DSA_SMSC_LAN9303_I2C
tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in I2C managed mode" tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in I2C managed mode"
depends on NET_DSA && I2C depends on I2C
select NET_DSA_SMSC_LAN9303 select NET_DSA_SMSC_LAN9303
select REGMAP_I2C select REGMAP_I2C
help help
...@@ -102,7 +97,6 @@ config NET_DSA_SMSC_LAN9303_I2C ...@@ -102,7 +97,6 @@ config NET_DSA_SMSC_LAN9303_I2C
config NET_DSA_SMSC_LAN9303_MDIO config NET_DSA_SMSC_LAN9303_MDIO
tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in MDIO managed mode" tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in MDIO managed mode"
depends on NET_DSA
select NET_DSA_SMSC_LAN9303 select NET_DSA_SMSC_LAN9303
help help
Enable access functions if the SMSC/Microchip LAN9303 is configured Enable access functions if the SMSC/Microchip LAN9303 is configured
...@@ -110,7 +104,6 @@ config NET_DSA_SMSC_LAN9303_MDIO ...@@ -110,7 +104,6 @@ config NET_DSA_SMSC_LAN9303_MDIO
config NET_DSA_VITESSE_VSC73XX config NET_DSA_VITESSE_VSC73XX
tristate tristate
depends on NET_DSA
select FIXED_PHY select FIXED_PHY
select VITESSE_PHY select VITESSE_PHY
select GPIOLIB select GPIOLIB
...@@ -120,7 +113,6 @@ config NET_DSA_VITESSE_VSC73XX ...@@ -120,7 +113,6 @@ config NET_DSA_VITESSE_VSC73XX
config NET_DSA_VITESSE_VSC73XX_SPI config NET_DSA_VITESSE_VSC73XX_SPI
tristate "Vitesse VSC7385/7388/7395/7398 SPI mode support" tristate "Vitesse VSC7385/7388/7395/7398 SPI mode support"
depends on NET_DSA
depends on SPI depends on SPI
select NET_DSA_VITESSE_VSC73XX select NET_DSA_VITESSE_VSC73XX
help help
...@@ -129,7 +121,6 @@ config NET_DSA_VITESSE_VSC73XX_SPI ...@@ -129,7 +121,6 @@ config NET_DSA_VITESSE_VSC73XX_SPI
config NET_DSA_VITESSE_VSC73XX_PLATFORM config NET_DSA_VITESSE_VSC73XX_PLATFORM
tristate "Vitesse VSC7385/7388/7395/7398 Platform mode support" tristate "Vitesse VSC7385/7388/7395/7398 Platform mode support"
depends on NET_DSA
depends on HAS_IOMEM depends on HAS_IOMEM
select NET_DSA_VITESSE_VSC73XX select NET_DSA_VITESSE_VSC73XX
help help
......
# SPDX-License-Identifier: GPL-2.0-only # SPDX-License-Identifier: GPL-2.0-only
config HAVE_NET_DSA
def_bool y
depends on INET && NETDEVICES && !S390
# Drivers must select NET_DSA and the appropriate tagging format
menuconfig NET_DSA menuconfig NET_DSA
tristate "Distributed Switch Architecture" tristate "Distributed Switch Architecture"
depends on HAVE_NET_DSA
depends on BRIDGE || BRIDGE=n depends on BRIDGE || BRIDGE=n
depends on HSR || HSR=n depends on HSR || HSR=n
depends on INET && NETDEVICES
select GRO_CELLS select GRO_CELLS
select NET_SWITCHDEV select NET_SWITCHDEV
select PHYLINK select PHYLINK
...@@ -20,7 +15,8 @@ menuconfig NET_DSA ...@@ -20,7 +15,8 @@ menuconfig NET_DSA
if NET_DSA if NET_DSA
# tagging formats # Drivers must select the appropriate tagging format(s)
config NET_DSA_TAG_8021Q config NET_DSA_TAG_8021Q
tristate tristate
select VLAN_8021Q select VLAN_8021Q
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment