diff options
author | Kevin Hilman <khilman@baylibre.com> | 2020-12-10 16:57:44 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-12-11 17:14:22 +0100 |
commit | 87a0b9f98ac5a14aae5b0fbcff930a240b24f827 (patch) | |
tree | 8481b29365216c12d018dd50ad700be49fa6bf25 /drivers/tty/serial/meson_uart.c | |
parent | d96f04d347e4011977abdbb4da5d8f303ebd26f8 (diff) | |
download | linux-87a0b9f98ac5a14aae5b0fbcff930a240b24f827.tar.gz |
tty: serial: meson: enable console as module
Enable serial driver to be built as a module. To do so, init the
console support on driver/module load instead of using
console_initcall().
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Link: https://lore.kernel.org/r/20201211005744.12855-1-khilman@baylibre.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/meson_uart.c')
-rw-r--r-- | drivers/tty/serial/meson_uart.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/tty/serial/meson_uart.c b/drivers/tty/serial/meson_uart.c index d2c08b760f83..69eeef9edfa5 100644 --- a/drivers/tty/serial/meson_uart.c +++ b/drivers/tty/serial/meson_uart.c @@ -604,7 +604,6 @@ static int __init meson_serial_console_init(void) register_console(&meson_serial_console); return 0; } -console_initcall(meson_serial_console_init); static void meson_serial_early_console_write(struct console *co, const char *s, @@ -634,6 +633,9 @@ OF_EARLYCON_DECLARE(meson, "amlogic,meson-ao-uart", #define MESON_SERIAL_CONSOLE (&meson_serial_console) #else +static int __init meson_serial_console_init(void) { + return 0; +} #define MESON_SERIAL_CONSOLE NULL #endif @@ -824,6 +826,10 @@ static int __init meson_uart_init(void) { int ret; + ret = meson_serial_console_init(); + if (ret) + return ret; + ret = uart_register_driver(&meson_uart_driver); if (ret) return ret; |