OpenCloudOS-Kernel/arch/mips/loongson2ef/common
Randy Dunlap ad548993a6 MIPS: loongson2ef: don't build serial.o unconditionally
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@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
2021-08-05 10:58:21 +02:00
..
cs5536 MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
Makefile MIPS: loongson2ef: don't build serial.o unconditionally 2021-08-05 10:58:21 +02:00
bonito-irq.c MIPS: Replace setup_irq() by request_irq() 2020-03-05 16:47:35 +01:00
env.c MIPS: Loongson{2ef, 32, 64} convert to generic fw cmdline 2019-11-11 10:44:56 -08:00
init.c MIPS: init: move externs to header file 2021-01-07 17:12:51 +01:00
irq.c
machtype.c MIPS: Loongson2ef: clean up loongson64 related code 2019-11-01 14:31:28 -07:00
mem.c MIPS: loongson2ef: remove function __uncached_access() 2021-01-27 21:51:15 +01:00
pci.c MIPS: Loongson2ef: clean up loongson64 related code 2019-11-01 14:31:28 -07:00
platform.c
pm.c MIPS: Loongson2ef: drop pointless static qualifier in loongson_suspend_enter() 2020-01-09 09:57:07 -08:00
reset.c remove ioremap_nocache and devm_ioremap_nocache 2020-01-06 09:45:59 +01:00
rtc.c
serial.c MIPS: Loongson2ef: clean up loongson64 related code 2019-11-01 14:31:28 -07:00
setup.c MIPS: Loongson2ef: clean up loongson64 related code 2019-11-01 14:31:28 -07:00
time.c MIPS: Loongson2ef: clean up loongson64 related code 2019-11-01 14:31:28 -07:00
uart_base.c MIPS: Loongson2ef: Convert to early_printk_8250 2019-11-11 10:45:00 -08:00