summaryrefslogtreecommitdiff
path: root/drivers/tty
diff options
context:
space:
mode:
authorChunyan Zhang <chunyan.zhang@unisoc.com>2020-03-16 18:19:28 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-17 15:20:41 +0100
commit72cc06be190a206abc3fcab236c6eddd5ebe0767 (patch)
treeee8d5e2afcca8b794447606cea9bdd8301245995 /drivers/tty
parentc3a834e87c2cd8ffe1c485a23892bb136c439ba0 (diff)
serial: sprd: check console via stdout-path in addition
The SPRD serial driver need to know which serial port would be used as console in an early period during initialization, the purpose is to keep the console port alive as possible even if there's some error caused by no clock configured under serial devicetree nodes. But with the patch [1], the console port couldn't be identified if missing console command line. So this patch adds using another interface to do check by reading stdout-path. [1] https://lore.kernel.org/lkml/20190826072929.7696-4-zhang.lyra@gmail.com/ Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com> Reviewed-by: Baolin Wang <baolin.wang7@gmail.com> Link: https://lore.kernel.org/r/20200316101930.9962-2-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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/tty/serial/sprd_serial.c b/drivers/tty/serial/sprd_serial.c
index 3d3c70634589..18706333f146 100644
--- a/drivers/tty/serial/sprd_serial.c
+++ b/drivers/tty/serial/sprd_serial.c
@@ -1147,7 +1147,8 @@ static bool sprd_uart_is_console(struct uart_port *uport)
{
struct console *cons = sprd_uart_driver.cons;
- if (cons && cons->index >= 0 && cons->index == uport->line)
+ if ((cons && cons->index >= 0 && cons->index == uport->line) ||
+ of_console_check(uport->dev->of_node, SPRD_TTY_NAME, uport->line))
return true;
return false;