[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210910002028.175174-17-sashal@kernel.org>
Date: Thu, 9 Sep 2021 20:19:52 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Randy Dunlap <rdunlap@...radead.org>,
kernel test robot <lkp@...el.com>,
Jiaxun Yang <jiaxun.yang@...goat.com>,
Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
linux-mips@...r.kernel.org, Sasha Levin <sashal@...nel.org>
Subject: [PATCH AUTOSEL 5.10 17/53] MIPS: loongson2ef: don't build serial.o unconditionally
From: Randy Dunlap <rdunlap@...radead.org>
[ Upstream commit ad548993a66c498267695edd8b19a682be0e3a8b ]
LOONGSON_UART_BASE depends on EARLY_PRINTK || SERIAL_8250, but when
neither of these Kconfig symbols is set, the kernel build has errors:
../arch/mips/loongson2ef/common/serial.c: In function 'serial_init':
../arch/mips/loongson2ef/common/serial.c:66:25: error: 'loongson_uart_base' undeclared (first use in this function)
66 | loongson_uart_base;
../arch/mips/loongson2ef/common/serial.c:66:25: note: each undeclared identifier is reported only once for each function it appears in
../arch/mips/loongson2ef/common/serial.c:68:41: error: '_loongson_uart_base' undeclared (first use in this function)
68 | (void __iomem *)_loongson_uart_base;
Fix this by building serial.o only when one (or both) of these
Kconfig symbols is enabled.
Tested with:
(a) EARLY_PRINTK=y, SERIAL_8250 not set;
(b) EARLY_PRINTK=y, SERIAL_8250=y;
(c) EARLY_PRINTK=y, SERIAL_8250=m.
(d) EARLY_PRINTK not set, SERIAL_8250=y;
(e) EARLY_PRINTK not set, SERIAL_8250=m;
(f) EARLY_PRINTK not set, SERIAL_8250 not set.
Signed-off-by: Randy Dunlap <rdunlap@...radead.org>
Reported-by: kernel test robot <lkp@...el.com>
Cc: Jiaxun Yang <jiaxun.yang@...goat.com>
Cc: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc: linux-mips@...r.kernel.org
Signed-off-by: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
arch/mips/loongson2ef/common/Makefile | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/mips/loongson2ef/common/Makefile b/arch/mips/loongson2ef/common/Makefile
index d5ab3e543ea3..30ea8b5ca685 100644
--- a/arch/mips/loongson2ef/common/Makefile
+++ b/arch/mips/loongson2ef/common/Makefile
@@ -4,12 +4,14 @@
#
obj-y += setup.o init.o env.o time.o reset.o irq.o \
- bonito-irq.o mem.o machtype.o platform.o serial.o
+ bonito-irq.o mem.o machtype.o platform.o
obj-$(CONFIG_PCI) += pci.o
#
# Serial port support
#
+obj-$(CONFIG_LOONGSON_UART_BASE) += serial.o
+obj-$(CONFIG_EARLY_PRINTK) += serial.o
obj-$(CONFIG_LOONGSON_UART_BASE) += uart_base.o
obj-$(CONFIG_LOONGSON_MC146818) += rtc.o
--
2.30.2
Powered by blists - more mailing lists