yt921x is already the longest single-file DSA driver, so it's time to split it into parts. Signed-off-by: David Yang Reviewed-by: Andrew Lunn --- MAINTAINERS | 2 +- drivers/net/dsa/Kconfig | 10 ++-------- drivers/net/dsa/Makefile | 2 +- drivers/net/dsa/motorcomm/Kconfig | 8 ++++++++ drivers/net/dsa/motorcomm/Makefile | 3 +++ drivers/net/dsa/{yt921x.c => motorcomm/chip.c} | 2 +- drivers/net/dsa/{yt921x.h => motorcomm/chip.h} | 0 7 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 drivers/net/dsa/motorcomm/Kconfig create mode 100644 drivers/net/dsa/motorcomm/Makefile rename drivers/net/dsa/{yt921x.c => motorcomm/chip.c} (99%) rename drivers/net/dsa/{yt921x.h => motorcomm/chip.h} (100%) diff --git a/MAINTAINERS b/MAINTAINERS index 0b42e898f4d8..4b0254f62277 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -18422,7 +18422,7 @@ M: David Yang L: netdev@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/net/dsa/motorcomm,yt921x.yaml -F: drivers/net/dsa/yt921x.* +F: drivers/net/dsa/motorcomm/ F: net/dsa/tag_yt921x.c MOXA SMARTIO/INDUSTIO/INTELLIO SERIAL CARD diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig index 676fb7dffe14..8d8edcf89f10 100644 --- a/drivers/net/dsa/Kconfig +++ b/drivers/net/dsa/Kconfig @@ -82,6 +82,8 @@ config NET_DSA_MV88E6060 source "drivers/net/dsa/microchip/Kconfig" +source "drivers/net/dsa/motorcomm/Kconfig" + source "drivers/net/dsa/mv88e6xxx/Kconfig" source "drivers/net/dsa/mxl862xx/Kconfig" @@ -168,12 +170,4 @@ config NET_DSA_VITESSE_VSC73XX_PLATFORM This enables support for the Vitesse VSC7385, VSC7388, VSC7395 and VSC7398 SparX integrated ethernet switches, connected over a CPU-attached address bus and work in memory-mapped I/O mode. - -config NET_DSA_YT921X - tristate "Motorcomm YT9215 ethernet switch chip support" - select NET_DSA_TAG_YT921X - select NET_IEEE8021Q_HELPERS if DCB - help - This enables support for the Motorcomm YT9215 ethernet switch - chip. endmenu diff --git a/drivers/net/dsa/Makefile b/drivers/net/dsa/Makefile index 6ceb78a755d7..df849cd0e640 100644 --- a/drivers/net/dsa/Makefile +++ b/drivers/net/dsa/Makefile @@ -15,11 +15,11 @@ obj-$(CONFIG_NET_DSA_SMSC_LAN9303_MDIO) += lan9303_mdio.o obj-$(CONFIG_NET_DSA_VITESSE_VSC73XX) += vitesse-vsc73xx-core.o obj-$(CONFIG_NET_DSA_VITESSE_VSC73XX_PLATFORM) += vitesse-vsc73xx-platform.o obj-$(CONFIG_NET_DSA_VITESSE_VSC73XX_SPI) += vitesse-vsc73xx-spi.o -obj-$(CONFIG_NET_DSA_YT921X) += yt921x.o obj-y += b53/ obj-y += hirschmann/ obj-y += lantiq/ obj-y += microchip/ +obj-y += motorcomm/ obj-y += mv88e6xxx/ obj-y += mxl862xx/ obj-y += netc/ diff --git a/drivers/net/dsa/motorcomm/Kconfig b/drivers/net/dsa/motorcomm/Kconfig new file mode 100644 index 000000000000..64ff7d07a91b --- /dev/null +++ b/drivers/net/dsa/motorcomm/Kconfig @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: GPL-2.0-only +config NET_DSA_YT921X + tristate "Motorcomm YT9215 ethernet switch chip support" + select NET_DSA_TAG_YT921X + select NET_IEEE8021Q_HELPERS if DCB + help + This enables support for the Motorcomm YT9215 ethernet switch + chip. diff --git a/drivers/net/dsa/motorcomm/Makefile b/drivers/net/dsa/motorcomm/Makefile new file mode 100644 index 000000000000..bf99feb4c454 --- /dev/null +++ b/drivers/net/dsa/motorcomm/Makefile @@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +obj-$(CONFIG_NET_DSA_YT921X) += yt921x.o +yt921x-objs := chip.o diff --git a/drivers/net/dsa/yt921x.c b/drivers/net/dsa/motorcomm/chip.c similarity index 99% rename from drivers/net/dsa/yt921x.c rename to drivers/net/dsa/motorcomm/chip.c index 44fcdd47ffb5..019b3a2d5d97 100644 --- a/drivers/net/dsa/yt921x.c +++ b/drivers/net/dsa/motorcomm/chip.c @@ -26,7 +26,7 @@ #include #include -#include "yt921x.h" +#include "chip.h" struct yt921x_mib_desc { unsigned int size; diff --git a/drivers/net/dsa/yt921x.h b/drivers/net/dsa/motorcomm/chip.h similarity index 100% rename from drivers/net/dsa/yt921x.h rename to drivers/net/dsa/motorcomm/chip.h -- 2.53.0