Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: ath25: Avoid undefined early_serial_setup() without SERIAL_8250_CONSOLE

Currently MIPS allnoconfig with CONFIG_ATH25=y fails to link due to
missing support for early_serial_setup():

LD vmlinux
arch/mips/ath25/devices.o: In function ath25_serial_setup':
devices.c:(.init.text+0x68): undefined reference to 'early_serial_setup'

Rather than adding dependencies to the platform to force inclusion of
SERIAL_8250_CONSOLE together with it's dependencies like TTY, HAS_IOMEM,
etc, just make ath25_serial_setup() a no-op when the dependency is not
selected in the kernel config.

Signed-off-by: Matt Redfearn <matt.redfearn@mips.com>
Cc: James Hogan <james.hogan@mips.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Cc: Kate Stewart <kstewart@linuxfoundation.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/17700/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Matt Redfearn and committed by
Ralf Baechle
9dd79fed 0a5191ef

+2
+2
arch/mips/ath25/devices.c
··· 73 73 74 74 void __init ath25_serial_setup(u32 mapbase, int irq, unsigned int uartclk) 75 75 { 76 + #ifdef CONFIG_SERIAL_8250_CONSOLE 76 77 struct uart_port s; 77 78 78 79 memset(&s, 0, sizeof(s)); ··· 86 85 s.uartclk = uartclk; 87 86 88 87 early_serial_setup(&s); 88 + #endif /* CONFIG_SERIAL_8250_CONSOLE */ 89 89 } 90 90 91 91 int __init ath25_add_wmac(int nr, u32 base, int irq)