From: Chunyan Zhang Date: Mon, 26 Aug 2019 07:29:28 +0000 (+0800) Subject: serial: sprd: add console_initcall in sprd's uart driver X-Git-Tag: v5.4-rc1~135^2~21 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e85c9d6786e5afc93c3a29582cf42ee4b00b1e08;p=linux.git serial: sprd: add console_initcall in sprd's uart driver Use console_initcall to save the console index we selected on the command line to sprd_console before probe finished. Thus we can make different processes to the uart devices during initialization according to whether it is used for console. Signed-off-by: Chunyan Zhang Signed-off-by: Chunyan Zhang Reviewed-by: Baolin Wang Tested-by: Baolin Wang Link: https://lore.kernel.org/r/20190826072929.7696-3-zhang.lyra@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c index 759ba2d0345e..6b9000f7adca 100644 --- a/drivers/tty/serial/sprd_serial.c +++ b/drivers/tty/serial/sprd_serial.c @@ -1016,6 +1016,13 @@ static struct console sprd_console = { .data = &sprd_uart_driver, }; +static int __init sprd_serial_console_init(void) +{ + register_console(&sprd_console); + return 0; +} +console_initcall(sprd_serial_console_init); + #define SPRD_CONSOLE (&sprd_console) /* Support for earlycon */