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

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

authored by

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

+1 -4
+1 -4
drivers/tty/serial/omap-serial.c
··· 16 16 * this driver as required for the omap-platform. 17 17 */ 18 18 19 - #if defined(CONFIG_SERIAL_OMAP_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 20 - #define SUPPORT_SYSRQ 21 - #endif 22 - 23 19 #include <linux/module.h> 24 20 #include <linux/init.h> 25 21 #include <linux/console.h> ··· 1679 1683 up->port.regshift = 2; 1680 1684 up->port.fifosize = 64; 1681 1685 up->port.ops = &serial_omap_pops; 1686 + up->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_OMAP_CONSOLE); 1682 1687 1683 1688 if (pdev->dev.of_node) 1684 1689 ret = of_alias_get_id(pdev->dev.of_node, "serial");