From: Vladimir Oltean <olteanv@gmail.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: UNGLinuxDriver@microchip.com, andrew@lunn.ch,
f.fainelli@gmail.com, vivien.didelot@gmail.com,
claudiu.manoil@nxp.com, alexandru.marginean@nxp.com,
xiaoliang.yang_1@nxp.com
Subject: [PATCH net-next 06/12] net: mscc: ocelot: convert MSCC_OCELOT_SWITCH into a library
Date: Sat, 20 Jun 2020 18:43:41 +0300 [thread overview]
Message-ID: <20200620154347.3587114-7-olteanv@gmail.com> (raw)
In-Reply-To: <20200620154347.3587114-1-olteanv@gmail.com>
From: Vladimir Oltean <vladimir.oltean@nxp.com>
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: Vladimir Oltean <vladimir.oltean@nxp.com>
---
drivers/net/dsa/ocelot/Kconfig | 4 +++-
drivers/net/ethernet/mscc/Kconfig | 18 ++++++++++--------
drivers/net/ethernet/mscc/Makefile | 13 ++++++++++---
3 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/drivers/net/dsa/ocelot/Kconfig b/drivers/net/dsa/ocelot/Kconfig
index a5b7cca03d09..3d3c2a6fb0c0 100644
--- a/drivers/net/dsa/ocelot/Kconfig
+++ b/drivers/net/dsa/ocelot/Kconfig
@@ -4,7 +4,9 @@ config NET_DSA_MSCC_FELIX
depends on NET_DSA && PCI
depends on NET_VENDOR_MICROSEMI
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 FSL_ENETC_MDIO
help
diff --git a/drivers/net/ethernet/mscc/Kconfig b/drivers/net/ethernet/mscc/Kconfig
index bcec0587cf61..24db927e8b30 100644
--- a/drivers/net/ethernet/mscc/Kconfig
+++ b/drivers/net/ethernet/mscc/Kconfig
@@ -11,20 +11,22 @@ config NET_VENDOR_MICROSEMI
if NET_VENDOR_MICROSEMI
-config MSCC_OCELOT_SWITCH
- tristate "Ocelot switch driver"
- depends on NET_SWITCHDEV
- depends on HAS_IOMEM
- select PHYLIB
- select REGMAP_MMIO
+# Users should depend on NET_SWITCHDEV, HAS_IOMEM, PHYLIB and REGMAP_MMIO
+config MSCC_OCELOT_SWITCH_LIB
+ tristate
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
tristate "Ocelot switch driver on Ocelot"
- depends on MSCC_OCELOT_SWITCH
+ depends on NET_SWITCHDEV
depends on GENERIC_PHY
+ depends on REGMAP_MMIO
+ depends on HAS_IOMEM
+ depends on PHYLIB
depends on OF_NET
+ select MSCC_OCELOT_SWITCH_LIB
help
This driver supports the Ocelot network switch device as present on
the Ocelot SoCs.
diff --git a/drivers/net/ethernet/mscc/Makefile b/drivers/net/ethernet/mscc/Makefile
index 53572bb76ccd..77222e47d63f 100644
--- a/drivers/net/ethernet/mscc/Makefile
+++ b/drivers/net/ethernet/mscc/Makefile
@@ -1,6 +1,13 @@
# SPDX-License-Identifier: (GPL-2.0 OR MIT)
-obj-$(CONFIG_MSCC_OCELOT_SWITCH) += mscc_ocelot_common.o
-mscc_ocelot_common-y := ocelot.o ocelot_io.o
-mscc_ocelot_common-y += ocelot_regs.o ocelot_tc.o ocelot_police.o ocelot_ace.o ocelot_flower.o ocelot_ptp.o
+obj-$(CONFIG_MSCC_OCELOT_SWITCH_LIB) += mscc_ocelot_switch_lib.o
+mscc_ocelot_switch_lib-y := \
+ 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
mscc_ocelot-y := ocelot_vsc7514.o
--
2.25.1
next prev parent reply other threads:[~2020-06-20 15:44 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-20 15:43 [PATCH net-next 00/12] Ocelot/Felix driver cleanup Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 01/12] net: dsa: felix: make vcap is2 keys and actions static Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 02/12] net: mscc: ocelot: use plain int when interacting with TCAM tables Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 03/12] net: mscc: ocelot: access EtherType using __be16 Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 04/12] net: mscc: ocelot: rename ocelot_board.c to ocelot_vsc7514.c Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 05/12] net: mscc: ocelot: rename module to mscc_ocelot Vladimir Oltean
2020-06-20 15:43 ` Vladimir Oltean [this message]
2020-06-20 15:43 ` [PATCH net-next 07/12] net: mscc: ocelot: rename MSCC_OCELOT_SWITCH_OCELOT to MSCC_OCELOT_SWITCH Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 08/12] net: mscc: ocelot: move ocelot_regs.c into ocelot_vsc7514.c Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 09/12] net: mscc: ocelot: move net_device related functions to ocelot_net.c Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 10/12] net: mscc: ocelot: rename ocelot_ace.{c,h} to ocelot_vcap.{c,h} Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 11/12] net: mscc: ocelot: generalize the "ACE/ACL" names Vladimir Oltean
2020-06-20 15:43 ` [PATCH net-next 12/12] net: mscc: ocelot: unexpose ocelot_vcap_policer_{add,del} Vladimir Oltean
2020-06-21 0:25 ` [PATCH net-next 00/12] Ocelot/Felix driver cleanup David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200620154347.3587114-7-olteanv@gmail.com \
--to=olteanv@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandru.marginean@nxp.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.com \
--cc=xiaoliang.yang_1@nxp.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.