From: Andy Shevchenko Date: Tue, 10 Mar 2020 17:43:36 +0000 (+0200) Subject: serial: core: Use uart_console() helper in SysRq code X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e140ef36925f54770fccb8e42be8cc8365221b51;p=openwrt%2Fstaging%2Fblogic.git serial: core: Use uart_console() helper in SysRq code Use uart_console() helper in SysRq code instead of open coded variant. This eliminates the conditional entirely for SERIAL_CORE_CONSOLE=n case. While here, refactor the conditional to be more compact. Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20200310174337.74109-3-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index c93d4e600f91..752655c80f73 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -3216,14 +3216,12 @@ int uart_handle_break(struct uart_port *port) if (port->handle_break) port->handle_break(port); - if (port->has_sysrq) { - if (port->cons && port->cons->index == port->line) { - if (!port->sysrq) { - port->sysrq = jiffies + SYSRQ_TIMEOUT; - return 1; - } - port->sysrq = 0; + if (port->has_sysrq && uart_console(port)) { + if (!port->sysrq) { + port->sysrq = jiffies + SYSRQ_TIMEOUT; + return 1; } + port->sysrq = 0; } if (port->flags & UPF_SAK)