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

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

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
581a367e dca3ac8d

+1 -4
+1 -4
drivers/tty/serial/milbeaut_usio.c
··· 3 3 * Copyright (C) 2018 Socionext Inc. 4 4 */ 5 5 6 - #if defined(CONFIG_SERIAL_MILBEAUT_USIO_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 7 - #define SUPPORT_SYSRQ 8 - #endif 9 - 10 6 #include <linux/clk.h> 11 7 #include <linux/console.h> 12 8 #include <linux/module.h> ··· 533 537 port->irq = mlb_usio_irq[index][RX]; 534 538 port->uartclk = clk_get_rate(clk); 535 539 port->fifosize = 128; 540 + port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MILBEAUT_USIO_CONSOLE); 536 541 port->iotype = UPIO_MEM32; 537 542 port->flags = UPF_BOOT_AUTOCONF | UPF_SPD_VHI; 538 543 port->line = index;