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

tty/serial: Migrate mxs-auart 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.

Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-28-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
2deed958 b4088e83

+1 -4
+1 -4
drivers/tty/serial/mxs-auart.c
··· 12 12 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. 13 13 */ 14 14 15 - #if defined(CONFIG_SERIAL_MXS_AUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 16 - #define SUPPORT_SYSRQ 17 - #endif 18 - 19 15 #include <linux/kernel.h> 20 16 #include <linux/errno.h> 21 17 #include <linux/init.h> ··· 1689 1693 s->port.fifosize = MXS_AUART_FIFO_SIZE; 1690 1694 s->port.uartclk = clk_get_rate(s->clk); 1691 1695 s->port.type = PORT_IMX; 1696 + s->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_MXS_AUART_CONSOLE); 1692 1697 1693 1698 mxs_init_regs(s); 1694 1699