Commit f4d0323b authored by Vladimir Oltean's avatar Vladimir Oltean Committed by David S. Miller

net: mscc: ocelot: convert MSCC_OCELOT_SWITCH into a library

Hide the CONFIG_MSCC_OCELOT_SWITCH option from users. It is meant to be
only a hardware library which is selected by the drivers that use it
(ocelot, felix).

Since it is "selected" from Kconfig, all its dependencies are manually
transferred to the driver that selects it. This is because "select" in
Kconfig language is a bit of a mess, and doesn't handle dependencies of
selected options quite right.
Signed-off-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 56583862
...@@ -4,7 +4,9 @@ config NET_DSA_MSCC_FELIX ...@@ -4,7 +4,9 @@ config NET_DSA_MSCC_FELIX
depends on NET_DSA && PCI depends on NET_DSA && PCI
depends on NET_VENDOR_MICROSEMI depends on NET_VENDOR_MICROSEMI
depends on NET_VENDOR_FREESCALE depends on NET_VENDOR_FREESCALE
select MSCC_OCELOT_SWITCH depends on HAS_IOMEM
depends on REGMAP_MMIO
select MSCC_OCELOT_SWITCH_LIB
select NET_DSA_TAG_OCELOT select NET_DSA_TAG_OCELOT
select FSL_ENETC_MDIO select FSL_ENETC_MDIO
help help
......
...@@ -11,20 +11,22 @@ config NET_VENDOR_MICROSEMI ...@@ -11,20 +11,22 @@ config NET_VENDOR_MICROSEMI
if NET_VENDOR_MICROSEMI if NET_VENDOR_MICROSEMI
config MSCC_OCELOT_SWITCH # Users should depend on NET_SWITCHDEV, HAS_IOMEM, PHYLIB and REGMAP_MMIO
tristate "Ocelot switch driver" config MSCC_OCELOT_SWITCH_LIB
depends on NET_SWITCHDEV tristate
depends on HAS_IOMEM
select PHYLIB
select REGMAP_MMIO
help help
This driver supports the Ocelot network switch device. This is a hardware support library for Ocelot network switches. It is
used by switchdev as well as by DSA drivers.
config MSCC_OCELOT_SWITCH_OCELOT config MSCC_OCELOT_SWITCH_OCELOT
tristate "Ocelot switch driver on Ocelot" tristate "Ocelot switch driver on Ocelot"
depends on MSCC_OCELOT_SWITCH depends on NET_SWITCHDEV
depends on GENERIC_PHY depends on GENERIC_PHY
depends on REGMAP_MMIO
depends on HAS_IOMEM
depends on PHYLIB
depends on OF_NET depends on OF_NET
select MSCC_OCELOT_SWITCH_LIB
help help
This driver supports the Ocelot network switch device as present on This driver supports the Ocelot network switch device as present on
the Ocelot SoCs. the Ocelot SoCs.
......
# SPDX-License-Identifier: (GPL-2.0 OR MIT) # SPDX-License-Identifier: (GPL-2.0 OR MIT)
obj-$(CONFIG_MSCC_OCELOT_SWITCH) += mscc_ocelot_common.o obj-$(CONFIG_MSCC_OCELOT_SWITCH_LIB) += mscc_ocelot_switch_lib.o
mscc_ocelot_common-y := ocelot.o ocelot_io.o mscc_ocelot_switch_lib-y := \
mscc_ocelot_common-y += ocelot_regs.o ocelot_tc.o ocelot_police.o ocelot_ace.o ocelot_flower.o ocelot_ptp.o ocelot.o \
ocelot_io.o \
ocelot_regs.o \
ocelot_tc.o \
ocelot_police.o \
ocelot_ace.o \
ocelot_flower.o \
ocelot_ptp.o
obj-$(CONFIG_MSCC_OCELOT_SWITCH_OCELOT) += mscc_ocelot.o obj-$(CONFIG_MSCC_OCELOT_SWITCH_OCELOT) += mscc_ocelot.o
mscc_ocelot-y := ocelot_vsc7514.o mscc_ocelot-y := ocelot_vsc7514.o
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