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

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

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
0889d23e 06129311

+1 -4
+1 -4
drivers/tty/serial/vr41xx_siu.c
··· 7 7 * Based on drivers/serial/8250.c, by Russell King. 8 8 */ 9 9 10 - #if defined(CONFIG_SERIAL_VR41XX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 11 - #define SUPPORT_SYSRQ 12 - #endif 13 - 14 10 #include <linux/console.h> 15 11 #include <linux/errno.h> 16 12 #include <linux/init.h> ··· 865 869 port = &siu_uart_ports[i]; 866 870 port->ops = &siu_uart_ops; 867 871 port->dev = &dev->dev; 872 + port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_VR41XX_CONSOLE); 868 873 869 874 retval = uart_add_one_port(&siu_uart_driver, port); 870 875 if (retval < 0) {