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

tty/serial: Migrate sccnxp 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-40-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
212d9371 b2fc67b9

+1 -4
+1 -4
drivers/tty/serial/sccnxp.c
··· 7 7 * Based on sc26xx.c, by Thomas Bogendörfer (tsbogend@alpha.franken.de) 8 8 */ 9 9 10 - #if defined(CONFIG_SERIAL_SCCNXP_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 11 - #define SUPPORT_SYSRQ 12 - #endif 13 - 14 10 #include <linux/clk.h> 15 11 #include <linux/delay.h> 16 12 #include <linux/err.h> ··· 996 1000 s->port[i].regshift = s->pdata.reg_shift; 997 1001 s->port[i].uartclk = uartclk; 998 1002 s->port[i].ops = &sccnxp_ops; 1003 + s->port[i].has_sysrq = IS_ENABLED(CONFIG_SERIAL_SCCNXP_CONSOLE); 999 1004 uart_add_one_port(&s->uart, &s->port[i]); 1000 1005 /* Set direction to input */ 1001 1006 if (s->chip->flags & SCCNXP_HAVE_IO)