Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: realtek: convert subdrivers into modules

Preparing for multiple interfaces support, the drivers
must be independent of realtek-smi.

Signed-off-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Tested-by: Arınç ÜNAL <arinc.unal@arinc9.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Luiz Angelo Daros de Luca and committed by
David S. Miller
765c39a4 cd645dc5

+35 -3
+18 -2
drivers/net/dsa/realtek/Kconfig
··· 2 2 menuconfig NET_DSA_REALTEK 3 3 tristate "Realtek Ethernet switch family support" 4 4 depends on NET_DSA 5 - select NET_DSA_TAG_RTL4_A 6 - select NET_DSA_TAG_RTL8_4 7 5 select FIXED_PHY 8 6 select IRQ_DOMAIN 9 7 select REALTEK_PHY ··· 16 18 help 17 19 Select to enable support for registering switches connected 18 20 through SMI. 21 + 22 + config NET_DSA_REALTEK_RTL8365MB 23 + tristate "Realtek RTL8365MB switch subdriver" 24 + default y 25 + depends on NET_DSA_REALTEK 26 + depends on NET_DSA_REALTEK_SMI 27 + select NET_DSA_TAG_RTL8_4 28 + help 29 + Select to enable support for Realtek RTL8365MB 30 + 31 + config NET_DSA_REALTEK_RTL8366RB 32 + tristate "Realtek RTL8366RB switch subdriver" 33 + default y 34 + depends on NET_DSA_REALTEK 35 + depends on NET_DSA_REALTEK_SMI 36 + select NET_DSA_TAG_RTL4_A 37 + help 38 + Select to enable support for Realtek RTL8366RB
+3 -1
drivers/net/dsa/realtek/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 obj-$(CONFIG_NET_DSA_REALTEK_SMI) += realtek-smi.o 3 - realtek-smi-objs := realtek-smi-core.o rtl8366.o rtl8366rb.o rtl8365mb.o 3 + obj-$(CONFIG_NET_DSA_REALTEK_RTL8366RB) += rtl8366.o 4 + rtl8366-objs := rtl8366-core.o rtl8366rb.o 5 + obj-$(CONFIG_NET_DSA_REALTEK_RTL8365MB) += rtl8365mb.o
+6
drivers/net/dsa/realtek/realtek-smi-core.c drivers/net/dsa/realtek/realtek-smi.c
··· 494 494 } 495 495 496 496 static const struct of_device_id realtek_smi_of_match[] = { 497 + #if IS_ENABLED(CONFIG_NET_DSA_REALTEK_RTL8366RB) 497 498 { 498 499 .compatible = "realtek,rtl8366rb", 499 500 .data = &rtl8366rb_variant, 500 501 }, 502 + #endif 501 503 { 502 504 /* FIXME: add support for RTL8366S and more */ 503 505 .compatible = "realtek,rtl8366s", 504 506 .data = NULL, 505 507 }, 508 + #if IS_ENABLED(CONFIG_NET_DSA_REALTEK_RTL8365MB) 506 509 { 507 510 .compatible = "realtek,rtl8365mb", 508 511 .data = &rtl8365mb_variant, 509 512 }, 513 + #endif 510 514 { /* sentinel */ }, 511 515 }; 512 516 MODULE_DEVICE_TABLE(of, realtek_smi_of_match); ··· 526 522 }; 527 523 module_platform_driver(realtek_smi_driver); 528 524 525 + MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); 526 + MODULE_DESCRIPTION("Driver for Realtek ethernet switch connected via SMI interface"); 529 527 MODULE_LICENSE("GPL");
+4
drivers/net/dsa/realtek/rtl8365mb.c
··· 1986 1986 .chip_data_sz = sizeof(struct rtl8365mb), 1987 1987 }; 1988 1988 EXPORT_SYMBOL_GPL(rtl8365mb_variant); 1989 + 1990 + MODULE_AUTHOR("Alvin Šipraga <alsi@bang-olufsen.dk>"); 1991 + MODULE_DESCRIPTION("Driver for RTL8365MB-VC ethernet switch"); 1992 + MODULE_LICENSE("GPL");
drivers/net/dsa/realtek/rtl8366.c drivers/net/dsa/realtek/rtl8366-core.c
+4
drivers/net/dsa/realtek/rtl8366rb.c
··· 1816 1816 .chip_data_sz = sizeof(struct rtl8366rb), 1817 1817 }; 1818 1818 EXPORT_SYMBOL_GPL(rtl8366rb_variant); 1819 + 1820 + MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>"); 1821 + MODULE_DESCRIPTION("Driver for RTL8366RB ethernet switch"); 1822 + MODULE_LICENSE("GPL");