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

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>

authored by

Kevin Hilman and committed by
Greg Kroah-Hartman
87a0b9f9 d96f04d3

+8 -2
+1 -1
drivers/tty/serial/Kconfig
··· 206 206 207 207 config SERIAL_MESON_CONSOLE 208 208 bool "Support for console on meson" 209 - depends on SERIAL_MESON=y 209 + depends on SERIAL_MESON 210 210 select SERIAL_CORE_CONSOLE 211 211 select SERIAL_EARLYCON 212 212 help
+7 -1
drivers/tty/serial/meson_uart.c
··· 604 604 register_console(&meson_serial_console); 605 605 return 0; 606 606 } 607 - console_initcall(meson_serial_console_init); 608 607 609 608 static void meson_serial_early_console_write(struct console *co, 610 609 const char *s, ··· 633 634 634 635 #define MESON_SERIAL_CONSOLE (&meson_serial_console) 635 636 #else 637 + static int __init meson_serial_console_init(void) { 638 + return 0; 639 + } 636 640 #define MESON_SERIAL_CONSOLE NULL 637 641 #endif 638 642 ··· 826 824 { 827 825 int ret; 828 826 827 + ret = meson_serial_console_init(); 828 + if (ret) 829 + return ret; 830 + 829 831 ret = uart_register_driver(&meson_uart_driver); 830 832 if (ret) 831 833 return ret;