[2/3] serial: sprd: add console_initcall in sprd's uart driver
diff mbox series

Message ID 20190826072929.7696-3-zhang.lyra@gmail.com
State Accepted
Commit e85c9d6786e5afc93c3a29582cf42ee4b00b1e08
Headers show
Series
  • keep console alive even if missing the 'enable' clock
Related show

Commit Message

Chunyan Zhang Aug. 26, 2019, 7:29 a.m. UTC
From: Chunyan Zhang <chunyan.zhang@unisoc.com>

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>
---
 drivers/tty/serial/sprd_serial.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch
diff mbox series

diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index a3be4e2dd019..aead823c650b 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -1008,6 +1008,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 */