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

tty: goldfish: Enable 'earlycon' only if built-in

Commit 3840ed9548f7 ("tty: goldfish: Implement support for kernel
'earlycon' parameter") breaks an allmodconfig config on x86:
| LD vmlinux.o
| MODPOST vmlinux.o
|drivers/tty/serial/earlycon.o: In function `parse_options':
|drivers/tty/serial/earlycon.c:97: undefined reference to `uart_parse_earlycon'
|Makefile:1005: recipe for target 'vmlinux' failed

earlycon.c::parse_options() invokes uart_parse_earlycon() from serial_core.c
which is compiled=m because GOLDFISH_TTY itself (and most others) are =m.
To avoid that, I'm adding the _CONSOLE config option which is selected if the
GOLDFISH module itself is =y since it doesn't need the early bits for the =m
case (other drivers do the same dance).
The alternative would be to move uart_parse_earlycon() from
serial_core.c to earlycon.c (we don't have that many users of that
function).

Fixes: 3840ed9548f7 ("tty: goldfish: Implement support for kernel
'earlycon' parameter")
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Miodrag Dinic <miodrag.dinic@mips.com>
Acked-by: Miodrag Dinic <miodrag.dinic@mips.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Sebastian Andrzej Siewior and committed by
Greg Kroah-Hartman
6a28fd2b 93ad8673

+7 -1
+5 -1
drivers/tty/Kconfig
··· 394 394 depends on GOLDFISH 395 395 select SERIAL_CORE 396 396 select SERIAL_CORE_CONSOLE 397 - select SERIAL_EARLYCON 398 397 help 399 398 Console and system TTY driver for the Goldfish virtual platform. 399 + 400 + config GOLDFISH_TTY_EARLY_CONSOLE 401 + bool 402 + default y if GOLDFISH_TTY=y 403 + select SERIAL_EARLYCON 400 404 401 405 config DA_TTY 402 406 bool "DA TTY"
+2
drivers/tty/goldfish.c
··· 433 433 return 0; 434 434 } 435 435 436 + #ifdef CONFIG_GOLDFISH_TTY_EARLY_CONSOLE 436 437 static void gf_early_console_putchar(struct uart_port *port, int ch) 437 438 { 438 439 __raw_writel(ch, port->membase); ··· 457 456 } 458 457 459 458 OF_EARLYCON_DECLARE(early_gf_tty, "google,goldfish-tty", gf_earlycon_setup); 459 + #endif 460 460 461 461 static const struct of_device_id goldfish_tty_of_match[] = { 462 462 { .compatible = "google,goldfish-tty", },