Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751786AbdK3IQh (ORCPT ); Thu, 30 Nov 2017 03:16:37 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:43286 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751591AbdK3IQg (ORCPT ); Thu, 30 Nov 2017 03:16:36 -0500 From: Sebastian Andrzej Siewior To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , Jiri Slaby , Miodrag Dinic , Goran Ferenc , Aleksandar Markovic , Sebastian Andrzej Siewior Subject: [PATCH] tty: goldfish: Enable 'earlycon' only if built-in Date: Thu, 30 Nov 2017 09:16:31 +0100 Message-Id: <20171130081631.3936-1-bigeasy@linutronix.de> X-Mailer: git-send-email 2.15.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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_early= con' |Makefile:1005: recipe for target 'vmlinux' failed earlycon.c::parse_options() invokes uart_parse_earlycon() from serial_core.c which is compiled=3Dm because GOLDFISH_TTY itself (and most others) are =3D= m. To avoid that, I'm adding the _CONSOLE config option which is selected if t= he GOLDFISH module itself is =3Dy since it doesn't need the early bits for the= =3Dm 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 --- drivers/tty/Kconfig | 6 +++++- drivers/tty/goldfish.c | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/tty/Kconfig b/drivers/tty/Kconfig index cc2b4d9433ed..b811442c5ce6 100644 --- a/drivers/tty/Kconfig +++ b/drivers/tty/Kconfig @@ -394,10 +394,14 @@ config GOLDFISH_TTY depends on GOLDFISH select SERIAL_CORE select SERIAL_CORE_CONSOLE - select SERIAL_EARLYCON help Console and system TTY driver for the Goldfish virtual platform. =20 +config GOLDFISH_TTY_EARLY_CONSOLE + bool + default y if GOLDFISH_TTY=3Dy + select SERIAL_EARLYCON + config DA_TTY bool "DA TTY" depends on METAG_DA diff --git a/drivers/tty/goldfish.c b/drivers/tty/goldfish.c index 381e981dee06..85a500ddbcaa 100644 --- a/drivers/tty/goldfish.c +++ b/drivers/tty/goldfish.c @@ -442,6 +442,7 @@ static int goldfish_tty_remove(struct platform_device *= pdev) return 0; } =20 +#ifdef CONFIG_GOLDFISH_TTY_EARLY_CONSOLE static void gf_early_console_putchar(struct uart_port *port, int ch) { __raw_writel(ch, port->membase); @@ -465,6 +466,7 @@ static int __init gf_earlycon_setup(struct earlycon_dev= ice *device, } =20 OF_EARLYCON_DECLARE(early_gf_tty, "google,goldfish-tty", gf_earlycon_setup= ); +#endif =20 static const struct of_device_id goldfish_tty_of_match[] =3D { { .compatible =3D "google,goldfish-tty", }, --=20 2.15.0