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

tty/serial: Migrate sunzilog 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: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-49-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
22cf28a8 831cb968

+2 -4
+2 -4
drivers/tty/serial/sunzilog.c
··· 40 40 #include <asm/prom.h> 41 41 #include <asm/setup.h> 42 42 43 - #if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 44 - #define SUPPORT_SYSRQ 45 - #endif 46 - 47 43 #include <linux/serial_core.h> 48 44 #include <linux/sunserialcore.h> 49 45 ··· 1440 1444 up[0].port.line = (inst * 2) + 0; 1441 1445 up[0].port.dev = &op->dev; 1442 1446 up[0].flags |= SUNZILOG_FLAG_IS_CHANNEL_A; 1447 + up[0].port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SUNZILOG_CONSOLE); 1443 1448 if (keyboard_mouse) 1444 1449 up[0].flags |= SUNZILOG_FLAG_CONS_KEYB; 1445 1450 sunzilog_init_hw(&up[0]); ··· 1458 1461 up[1].port.line = (inst * 2) + 1; 1459 1462 up[1].port.dev = &op->dev; 1460 1463 up[1].flags |= 0; 1464 + up[1].port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_SUNZILOG_CONSOLE); 1461 1465 if (keyboard_mouse) 1462 1466 up[1].flags |= SUNZILOG_FLAG_CONS_MOUSE; 1463 1467 sunzilog_init_hw(&up[1]);