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

tty/serial: Migrate clps711x 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: Alexander Shiyan <shc_work@mail.ru>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-14-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
76f82db9 078abd98

+1 -4
+1 -4
drivers/tty/serial/clps711x.c
··· 8 8 * Copyright (C) 2000 Deep Blue Solutions Ltd. 9 9 */ 10 10 11 - #if defined(CONFIG_SERIAL_CLPS711X_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 12 - #define SUPPORT_SYSRQ 13 - #endif 14 - 15 11 #include <linux/module.h> 16 12 #include <linux/device.h> 17 13 #include <linux/console.h> ··· 475 479 s->port.mapbase = res->start; 476 480 s->port.type = PORT_CLPS711X; 477 481 s->port.fifosize = 16; 482 + s->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_CLPS711X_CONSOLE); 478 483 s->port.flags = UPF_SKIP_TEST | UPF_FIXED_TYPE; 479 484 s->port.uartclk = clk_get_rate(uart_clk); 480 485 s->port.ops = &uart_clps711x_ops;