diff options
author | Chunyan Zhang <chunyan.zhang@unisoc.com> | 2019-08-26 10:29:28 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-04 13:43:55 +0300 |
commit | e85c9d6786e5afc93c3a29582cf42ee4b00b1e08 (patch) | |
tree | 935ba050166c6bd7288eabe57fc4eeffc1e523a6 /drivers/tty | |
parent | 99038fe75afaef59e20417d593a9d618d3ea14e6 (diff) | |
download | linux-e85c9d6786e5afc93c3a29582cf42ee4b00b1e08.tar.xz |
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 <chunyan.zhang@unisoc.com>
Signed-off-by: Chunyan Zhang <zhang.lyra@gmail.com>
Reviewed-by: Baolin Wang <baolin.wang@linaro.org>
Tested-by: Baolin Wang <baolin.wang@linaro.org>
Link: https://lore.kernel.org/r/20190826072929.7696-3-zhang.lyra@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/sprd_serial.c | 7 |
1 files changed, 7 insertions, 0 deletions
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 */ |