Re: [PATCH] MIPS: ralink: export rt_sysc_membase for rt2880_wdt.c

From: Guenter Roeck
Date: Mon May 17 2021 - 01:06:44 EST


On 5/16/21 5:54 PM, Randy Dunlap wrote:
rt2880_wdt.c uses (well, attempts to use) rt_sysc_membase. However,
when this watchdog driver is built as a loadable module, there is a
build error since the rt_sysc_membase symbol is not exported.
Export it to quell the build error.

ERROR: modpost: "rt_sysc_membase" [drivers/watchdog/rt2880_wdt.ko] undefined!

Fixes: 473cf939ff34 ("watchdog: add ralink watchdog driver")
Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Guenter Roeck <linux@xxxxxxxxxxxx>
Cc: Wim Van Sebroeck <wim@xxxxxxxxx>

Acked-by: Guenter Roeck <linux@xxxxxxxxxxxx>

Cc: John Crispin <john@xxxxxxxxxxx>
Cc: linux-mips@xxxxxxxxxxxxxxx
Cc: linux-watchdog@xxxxxxxxxxxxxxx
---
or make the Kconfig symbol RALINK_WDT bool instead of tristate?


You'd have to change several other config symbols to boolean as well.

Example with PHY_MT7621_PCI=m:

ERROR: modpost: "rt_sysc_membase" [drivers/phy/ralink/phy-mt7621-pci.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:150: modules-only.symvers] Error 1

Same with MT7621_WDT=m.

ERROR: modpost: "rt_sysc_membase" [drivers/watchdog/mt7621_wdt.ko] undefined!

At that point I stopped looking.

Guenter

arch/mips/ralink/of.c | 2 ++
1 file changed, 2 insertions(+)

--- linux-next-20210514.orig/arch/mips/ralink/of.c
+++ linux-next-20210514/arch/mips/ralink/of.c
@@ -8,6 +8,7 @@
#include <linux/io.h>
#include <linux/clk.h>
+#include <linux/export.h>
#include <linux/init.h>
#include <linux/sizes.h>
#include <linux/of_fdt.h>
@@ -25,6 +26,7 @@
__iomem void *rt_sysc_membase;
__iomem void *rt_memc_membase;
+EXPORT_SYMBOL_GPL(rt_sysc_membase);
__iomem void *plat_of_remap_node(const char *node)
{