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

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

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
b2fc67b9 386ae3b7

+1 -4
+1 -4
drivers/tty/serial/sb1250-duart.c
··· 15 15 * "BCM1250/BCM1125/BCM1125H User Manual", Broadcom Corporation 16 16 */ 17 17 18 - #if defined(CONFIG_SERIAL_SB1250_DUART_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 19 - #define SUPPORT_SYSRQ 20 - #endif 21 - 22 18 #include <linux/compiler.h> 23 19 #include <linux/console.h> 24 20 #include <linux/delay.h> ··· 809 813 uport->ops = &sbd_ops; 810 814 uport->line = line; 811 815 uport->mapbase = SBD_CHANREGS(line); 816 + uport->has_sysrq = IS_ENABLED(CONFIG_SERIAL_SB1250_DUART_CONSOLE); 812 817 } 813 818 } 814 819 }