Skip to content

Commit d60bc62

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: seville: build as separate module
Seville does not need to depend on PCI or on the ENETC MDIO controller. There will also be other compile-time differences in the future. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2ac7c6c commit d60bc62

6 files changed

Lines changed: 29 additions & 39 deletions

File tree

‎drivers/net/dsa/ocelot/Kconfig‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ config NET_DSA_MSCC_FELIX
1010
select FSL_ENETC_MDIO
1111
select PCS_LYNX
1212
help
13-
This driver supports network switches from the Vitesse /
14-
Microsemi / Microchip Ocelot family of switching cores that are
15-
connected to their host CPU via Ethernet.
16-
The following switches are supported:
17-
- VSC9959 (Felix): embedded as a PCIe function of the NXP LS1028A
18-
ENETC integrated endpoint.
19-
- VSC9953 (Seville): embedded as a platform device on the
20-
NXP T1040 SoC.
13+
This driver supports the VSC9959 (Felix) switch, which is embedded as
14+
a PCIe function of the NXP LS1028A ENETC RCiEP.
15+
16+
config NET_DSA_MSCC_SEVILLE
17+
tristate "Ocelot / Seville Ethernet switch support"
18+
depends on NET_DSA
19+
depends on NET_VENDOR_MICROSEMI
20+
depends on HAS_IOMEM
21+
select MSCC_OCELOT_SWITCH_LIB
22+
select NET_DSA_TAG_OCELOT
23+
select PCS_LYNX
24+
help
25+
This driver supports the VSC9953 (Seville) switch, which is embedded
26+
as a platform device on the NXP T1040 SoC.

‎drivers/net/dsa/ocelot/Makefile‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
obj-$(CONFIG_NET_DSA_MSCC_FELIX) += mscc_felix.o
3+
obj-$(CONFIG_NET_DSA_MSCC_SEVILLE) += mscc_seville.o
34

45
mscc_felix-objs := \
56
felix.o \
6-
felix_vsc9959.o \
7+
felix_vsc9959.o
8+
9+
mscc_seville-objs := \
10+
felix.o \
711
seville_vsc9953.o

‎drivers/net/dsa/ocelot/felix.c‎

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -782,29 +782,3 @@ const struct dsa_switch_ops felix_switch_ops = {
782782
.cls_flower_stats = felix_cls_flower_stats,
783783
.port_setup_tc = felix_port_setup_tc,
784784
};
785-
786-
static int __init felix_init(void)
787-
{
788-
int err;
789-
790-
err = pci_register_driver(&felix_vsc9959_pci_driver);
791-
if (err)
792-
return err;
793-
794-
err = platform_driver_register(&seville_vsc9953_driver);
795-
if (err)
796-
return err;
797-
798-
return 0;
799-
}
800-
module_init(felix_init);
801-
802-
static void __exit felix_exit(void)
803-
{
804-
pci_unregister_driver(&felix_vsc9959_pci_driver);
805-
platform_driver_unregister(&seville_vsc9953_driver);
806-
}
807-
module_exit(felix_exit);
808-
809-
MODULE_DESCRIPTION("Felix Switch driver");
810-
MODULE_LICENSE("GPL v2");

‎drivers/net/dsa/ocelot/felix.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ struct felix_info {
4242
};
4343

4444
extern const struct dsa_switch_ops felix_switch_ops;
45-
extern struct pci_driver felix_vsc9959_pci_driver;
46-
extern struct platform_driver seville_vsc9953_driver;
4745

4846
/* DSA glue / front-end for struct ocelot */
4947
struct felix {

‎drivers/net/dsa/ocelot/felix_vsc9959.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,9 +1328,13 @@ static struct pci_device_id felix_ids[] = {
13281328
};
13291329
MODULE_DEVICE_TABLE(pci, felix_ids);
13301330

1331-
struct pci_driver felix_vsc9959_pci_driver = {
1331+
static struct pci_driver felix_vsc9959_pci_driver = {
13321332
.name = "mscc_felix",
13331333
.id_table = felix_ids,
13341334
.probe = felix_pci_probe,
13351335
.remove = felix_pci_remove,
13361336
};
1337+
module_pci_driver(felix_vsc9959_pci_driver);
1338+
1339+
MODULE_DESCRIPTION("Felix Switch driver");
1340+
MODULE_LICENSE("GPL v2");

‎drivers/net/dsa/ocelot/seville_vsc9953.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,11 +1110,15 @@ static const struct of_device_id seville_of_match[] = {
11101110
};
11111111
MODULE_DEVICE_TABLE(of, seville_of_match);
11121112

1113-
struct platform_driver seville_vsc9953_driver = {
1113+
static struct platform_driver seville_vsc9953_driver = {
11141114
.probe = seville_probe,
11151115
.remove = seville_remove,
11161116
.driver = {
11171117
.name = "mscc_seville",
11181118
.of_match_table = of_match_ptr(seville_of_match),
11191119
},
11201120
};
1121+
module_platform_driver(seville_vsc9953_driver);
1122+
1123+
MODULE_DESCRIPTION("Seville Switch driver");
1124+
MODULE_LICENSE("GPL v2");

0 commit comments

Comments
 (0)