Skip to content

Commit 1cd7523

Browse files
Danielmachondavem330
authored andcommitted
net: lan969x: fix cyclic dependency reported by depmod
Depmod reports a cyclic dependency between modules sparx5-switch.ko and lan969x-switch.ko: depmod: ERROR: Cycle detected: lan969x_switch -> sparx5_switch -> lan969x_switch depmod: ERROR: Found 2 modules in dependency cycles! make[2]: *** [scripts/Makefile.modinst:132: depmod] Error 1 make: *** [Makefile:224: __sub-make] Error 2 This makes sense, as they both require symbols from each other. Fix this by compiling lan969x support into the sparx5-switch.ko module. In order to do this, in a sensible way, we move the lan969x/ dir into the sparx5/ dir and do some code cleanup of code that is no longer required. After this patch, depmod will no longer complain, as lan969x support is compiled into the sparx5-swicth.ko module, and can no longer be compiled as a standalone module. Fixes: 98a0111 ("net: sparx5: add compatible string for lan969x") Signed-off-by: Daniel Machon <daniel.machon@microchip.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 09310cf commit 1cd7523

File tree

16 files changed

+15
-31
lines changed

16 files changed

+15
-31
lines changed

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15343,7 +15343,7 @@ M: Daniel Machon <daniel.machon@microchip.com>
1534315343
M: UNGLinuxDriver@microchip.com
1534415344
L: netdev@vger.kernel.org
1534515345
S: Maintained
15346-
F: drivers/net/ethernet/microchip/lan969x/*
15346+
F: drivers/net/ethernet/microchip/sparx5/lan969x/*
1534715347

1534815348
MICROCHIP LCDFB DRIVER
1534915349
M: Nicolas Ferre <nicolas.ferre@microchip.com>

drivers/net/ethernet/microchip/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ config LAN743X
5959

6060
source "drivers/net/ethernet/microchip/lan865x/Kconfig"
6161
source "drivers/net/ethernet/microchip/lan966x/Kconfig"
62-
source "drivers/net/ethernet/microchip/lan969x/Kconfig"
6362
source "drivers/net/ethernet/microchip/sparx5/Kconfig"
6463
source "drivers/net/ethernet/microchip/vcap/Kconfig"
6564
source "drivers/net/ethernet/microchip/fdma/Kconfig"

drivers/net/ethernet/microchip/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ lan743x-objs := lan743x_main.o lan743x_ethtool.o lan743x_ptp.o
1111

1212
obj-$(CONFIG_LAN865X) += lan865x/
1313
obj-$(CONFIG_LAN966X_SWITCH) += lan966x/
14-
obj-$(CONFIG_LAN969X_SWITCH) += lan969x/
1514
obj-$(CONFIG_SPARX5_SWITCH) += sparx5/
1615
obj-$(CONFIG_VCAP) += vcap/
1716
obj-$(CONFIG_FDMA) += fdma/

drivers/net/ethernet/microchip/lan969x/Kconfig

Lines changed: 0 additions & 5 deletions
This file was deleted.

drivers/net/ethernet/microchip/lan969x/Makefile

Lines changed: 0 additions & 13 deletions
This file was deleted.

drivers/net/ethernet/microchip/sparx5/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@ config SPARX5_DCB
2424
DSCP and PCP.
2525

2626
If unsure, set to Y.
27+
28+
config LAN969X_SWITCH
29+
bool "Lan969x switch driver"
30+
depends on SPARX5_SWITCH
31+
help
32+
This driver supports the lan969x family of network switch devices.

drivers/net/ethernet/microchip/sparx5/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ sparx5-switch-y := sparx5_main.o sparx5_packet.o \
1616
sparx5-switch-$(CONFIG_SPARX5_DCB) += sparx5_dcb.o
1717
sparx5-switch-$(CONFIG_DEBUG_FS) += sparx5_vcap_debugfs.o
1818

19+
sparx5-switch-$(CONFIG_LAN969X_SWITCH) += lan969x/lan969x_regs.o \
20+
lan969x/lan969x.o \
21+
lan969x/lan969x_calendar.o \
22+
lan969x/lan969x_vcap_ag_api.o \
23+
lan969x/lan969x_vcap_impl.o
24+
1925
# Provide include files
2026
ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/vcap
2127
ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/fdma

drivers/net/ethernet/microchip/lan969x/lan969x.c renamed to drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,3 @@ const struct sparx5_match_data lan969x_desc = {
346346
.consts = &lan969x_consts,
347347
.ops = &lan969x_ops,
348348
};
349-
EXPORT_SYMBOL_GPL(lan969x_desc);
350-
351-
MODULE_DESCRIPTION("Microchip lan969x switch driver");
352-
MODULE_AUTHOR("Daniel Machon <daniel.machon@microchip.com>");
353-
MODULE_LICENSE("Dual MIT/GPL");

0 commit comments

Comments
 (0)