]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
net: lan969x: fix cyclic dependency reported by depmod
authorDaniel Machon <daniel.machon@microchip.com>
Thu, 5 Dec 2024 13:54:24 +0000 (14:54 +0100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 9 Dec 2024 13:30:16 +0000 (13:30 +0000)
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: 98a01119608d ("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>
16 files changed:
MAINTAINERS
drivers/net/ethernet/microchip/Kconfig
drivers/net/ethernet/microchip/Makefile
drivers/net/ethernet/microchip/lan969x/Kconfig [deleted file]
drivers/net/ethernet/microchip/lan969x/Makefile [deleted file]
drivers/net/ethernet/microchip/sparx5/Kconfig
drivers/net/ethernet/microchip/sparx5/Makefile
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c [moved from drivers/net/ethernet/microchip/lan969x/lan969x.c with 98% similarity]
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.h [moved from drivers/net/ethernet/microchip/lan969x/lan969x.h with 100% similarity]
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_calendar.c [moved from drivers/net/ethernet/microchip/lan969x/lan969x_calendar.c with 100% similarity]
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_regs.c [moved from drivers/net/ethernet/microchip/lan969x/lan969x_regs.c with 100% similarity]
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_vcap_ag_api.c [moved from drivers/net/ethernet/microchip/lan969x/lan969x_vcap_ag_api.c with 100% similarity]
drivers/net/ethernet/microchip/sparx5/lan969x/lan969x_vcap_impl.c [moved from drivers/net/ethernet/microchip/lan969x/lan969x_vcap_impl.c with 100% similarity]
drivers/net/ethernet/microchip/sparx5/sparx5_calendar.c
drivers/net/ethernet/microchip/sparx5/sparx5_main.c
drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c

index 686109008d8e0924e723f4bd71cbd909776f8bcb..f84ec3572a5df76375f93d5c440172b5add1aa9c 100644 (file)
@@ -15343,7 +15343,7 @@ M:      Daniel Machon <daniel.machon@microchip.com>
 M:     UNGLinuxDriver@microchip.com
 L:     netdev@vger.kernel.org
 S:     Maintained
-F:     drivers/net/ethernet/microchip/lan969x/*
+F:     drivers/net/ethernet/microchip/sparx5/lan969x/*
 
 MICROCHIP LCDFB DRIVER
 M:     Nicolas Ferre <nicolas.ferre@microchip.com>
index 73832fb2bc32fae8ffd019f9848f8581f6bbd8f6..ee046468652c7536934d1066af0ad6bd4b229373 100644 (file)
@@ -59,7 +59,6 @@ config LAN743X
 
 source "drivers/net/ethernet/microchip/lan865x/Kconfig"
 source "drivers/net/ethernet/microchip/lan966x/Kconfig"
-source "drivers/net/ethernet/microchip/lan969x/Kconfig"
 source "drivers/net/ethernet/microchip/sparx5/Kconfig"
 source "drivers/net/ethernet/microchip/vcap/Kconfig"
 source "drivers/net/ethernet/microchip/fdma/Kconfig"
index 7770df82200f1c17bbd5ff8fbaf2be51e7f82fb1..3c65baed9fd876267767a309d23338d27e898887 100644 (file)
@@ -11,7 +11,6 @@ lan743x-objs := lan743x_main.o lan743x_ethtool.o lan743x_ptp.o
 
 obj-$(CONFIG_LAN865X) += lan865x/
 obj-$(CONFIG_LAN966X_SWITCH) += lan966x/
-obj-$(CONFIG_LAN969X_SWITCH) += lan969x/
 obj-$(CONFIG_SPARX5_SWITCH) += sparx5/
 obj-$(CONFIG_VCAP) += vcap/
 obj-$(CONFIG_FDMA) += fdma/
diff --git a/drivers/net/ethernet/microchip/lan969x/Kconfig b/drivers/net/ethernet/microchip/lan969x/Kconfig
deleted file mode 100644 (file)
index c5c6122..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-config LAN969X_SWITCH
-       bool "Lan969x switch driver"
-       depends on SPARX5_SWITCH
-       help
-         This driver supports the lan969x family of network switch devices.
diff --git a/drivers/net/ethernet/microchip/lan969x/Makefile b/drivers/net/ethernet/microchip/lan969x/Makefile
deleted file mode 100644 (file)
index 316405c..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Makefile for the Microchip lan969x network device drivers.
-#
-
-obj-$(CONFIG_SPARX5_SWITCH) += lan969x-switch.o
-
-lan969x-switch-y := lan969x_regs.o lan969x.o lan969x_calendar.o \
- lan969x_vcap_ag_api.o lan969x_vcap_impl.o
-
-# Provide include files
-ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/fdma
-ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/vcap
index 3f04992eace6ab96847caa8e9adb9f0ba4e28304..35b057c9d0cb61c0dae44e7c9dd997e41766c670 100644 (file)
@@ -24,3 +24,9 @@ config SPARX5_DCB
          DSCP and PCP.
 
          If unsure, set to Y.
+
+config LAN969X_SWITCH
+       bool "Lan969x switch driver"
+       depends on SPARX5_SWITCH
+       help
+         This driver supports the lan969x family of network switch devices.
index 3435ca86dd70949dda57bfe0587792c0547ded63..4bf2a885a9da473d54ee5fe1581e71f04ed5384c 100644 (file)
@@ -16,6 +16,12 @@ sparx5-switch-y  := sparx5_main.o sparx5_packet.o \
 sparx5-switch-$(CONFIG_SPARX5_DCB) += sparx5_dcb.o
 sparx5-switch-$(CONFIG_DEBUG_FS) += sparx5_vcap_debugfs.o
 
+sparx5-switch-$(CONFIG_LAN969X_SWITCH) += lan969x/lan969x_regs.o \
+                                         lan969x/lan969x.o \
+                                         lan969x/lan969x_calendar.o \
+                                         lan969x/lan969x_vcap_ag_api.o \
+                                         lan969x/lan969x_vcap_impl.o
+
 # Provide include files
 ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/vcap
 ccflags-y += -I$(srctree)/drivers/net/ethernet/microchip/fdma
similarity index 98%
rename from drivers/net/ethernet/microchip/lan969x/lan969x.c
rename to drivers/net/ethernet/microchip/sparx5/lan969x/lan969x.c
index ac37d0f74ee3278972c601378ea41433109c38b7..67463d41d10e7888e2be02a93350a7474641d98f 100644 (file)
@@ -346,8 +346,3 @@ const struct sparx5_match_data lan969x_desc = {
        .consts     = &lan969x_consts,
        .ops        = &lan969x_ops,
 };
-EXPORT_SYMBOL_GPL(lan969x_desc);
-
-MODULE_DESCRIPTION("Microchip lan969x switch driver");
-MODULE_AUTHOR("Daniel Machon <daniel.machon@microchip.com>");
-MODULE_LICENSE("Dual MIT/GPL");
index 5fe941c66c175d9ada4d621c03caaba682237eff..5c46d81de53006286c0ff763f6bd84c97da9ca8e 100644 (file)
@@ -98,7 +98,6 @@ u32 sparx5_cal_speed_to_value(enum sparx5_cal_bw speed)
        default: return 0;
        }
 }
-EXPORT_SYMBOL_GPL(sparx5_cal_speed_to_value);
 
 static u32 sparx5_bandwidth_to_calendar(u32 bw)
 {
@@ -150,7 +149,6 @@ enum sparx5_cal_bw sparx5_get_port_cal_speed(struct sparx5 *sparx5, u32 portno)
                return SPX5_CAL_SPEED_NONE;
        return sparx5_bandwidth_to_calendar(port->conf.bandwidth);
 }
-EXPORT_SYMBOL_GPL(sparx5_get_port_cal_speed);
 
 /* Auto configure the QSYS calendar based on port configuration */
 int sparx5_config_auto_calendar(struct sparx5 *sparx5)
index 2f1013f870fbf2b84db07cd3565b0c35261b7caa..2b58fcb9422e9a1be3dbd3df46477a9214494733 100644 (file)
@@ -24,7 +24,7 @@
 #include <linux/types.h>
 #include <linux/reset.h>
 
-#include "../lan969x/lan969x.h" /* for lan969x match data */
+#include "lan969x/lan969x.h" /* for lan969x match data */
 
 #include "sparx5_main_regs.h"
 #include "sparx5_main.h"
@@ -1093,7 +1093,7 @@ static const struct sparx5_match_data sparx5_desc = {
 
 static const struct of_device_id mchp_sparx5_match[] = {
        { .compatible = "microchip,sparx5-switch", .data = &sparx5_desc },
-#if IS_ENABLED(CONFIG_LAN969X_SWITCH)
+#ifdef CONFIG_LAN969X_SWITCH
        { .compatible = "microchip,lan9691-switch", .data = &lan969x_desc },
 #endif
        { }
index 1c2903700a9cfc72d9700004d3a25d0a03f01575..2f168700f63c113c9d0571ee13cc127e56b81da5 100644 (file)
@@ -303,7 +303,6 @@ void sparx5_get_hwtimestamp(struct sparx5 *sparx5,
 
        spin_unlock_irqrestore(&sparx5->ptp_clock_lock, flags);
 }
-EXPORT_SYMBOL_GPL(sparx5_get_hwtimestamp);
 
 irqreturn_t sparx5_ptp_irq_handler(int irq, void *args)
 {