tty/serial: Migrate fsl_lpuart to use has_sysrq
The SUPPORT_SYSRQ ifdeffery is not nice as: - May create misunderstanding about sizeof(struct uart_port) between different objects - Prevents moving functions from serial_core.h - Reduces readability (well, it's ifdeffery - it's hard to follow) In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added. Initialise it in driver's probe and remove ifdeffery. Signed-off-by: Dmitry Safonov <dima@arista.com> Link: https://lore.kernel.org/r/20191213000657.931618-19-dima@arista.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
4151bbed79
Коммит
4d9ec1c0ce
|
@ -5,10 +5,6 @@
|
|||
* Copyright 2012-2014 Freescale Semiconductor, Inc.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_SERIAL_FSL_LPUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
|
||||
#define SUPPORT_SYSRQ
|
||||
#endif
|
||||
|
||||
#include <linux/clk.h>
|
||||
#include <linux/console.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
|
@ -864,9 +860,7 @@ static void lpuart_rxint(struct lpuart_port *sport)
|
|||
if (sr & UARTSR1_OR)
|
||||
flg = TTY_OVERRUN;
|
||||
|
||||
#ifdef SUPPORT_SYSRQ
|
||||
sport->port.sysrq = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
tty_insert_flip_char(port, rx, flg);
|
||||
|
@ -946,9 +940,7 @@ static void lpuart32_rxint(struct lpuart_port *sport)
|
|||
if (sr & UARTSTAT_OR)
|
||||
flg = TTY_OVERRUN;
|
||||
|
||||
#ifdef SUPPORT_SYSRQ
|
||||
sport->port.sysrq = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
tty_insert_flip_char(port, rx, flg);
|
||||
|
@ -2461,6 +2453,7 @@ static int lpuart_probe(struct platform_device *pdev)
|
|||
sport->port.ops = &lpuart32_pops;
|
||||
else
|
||||
sport->port.ops = &lpuart_pops;
|
||||
sport->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_FSL_LPUART_CONSOLE);
|
||||
sport->port.flags = UPF_BOOT_AUTOCONF;
|
||||
|
||||
if (lpuart_is_32(sport))
|
||||
|
|
Загрузка…
Ссылка в новой задаче