diff options
author | Dmitry Safonov <dima@arista.com> | 2019-12-13 01:06:31 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-18 15:04:57 +0100 |
commit | fd6dbe4e7949d17317b57465bb1e9ed7cd18051a (patch) | |
tree | 39d01c616d2962d6e5a26090d290ba0e11218b15 /drivers/tty/serial/pnx8xxx_uart.c | |
parent | tty/serial: Migrate pmac_zilog to use has_sysrq (diff) | |
download | linux-fd6dbe4e7949d17317b57465bb1e9ed7cd18051a.tar.xz linux-fd6dbe4e7949d17317b57465bb1e9ed7cd18051a.zip |
tty/serial: Migrate pnx8xxx_uart 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-33-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/pnx8xxx_uart.c')
-rw-r--r-- | drivers/tty/serial/pnx8xxx_uart.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/tty/serial/pnx8xxx_uart.c b/drivers/tty/serial/pnx8xxx_uart.c index 223a9499104e..972d94e8d32b 100644 --- a/drivers/tty/serial/pnx8xxx_uart.c +++ b/drivers/tty/serial/pnx8xxx_uart.c @@ -10,10 +10,6 @@ * Copyright (C) 2000 Deep Blue Solutions Ltd. */ -#if defined(CONFIG_SERIAL_PNX8XXX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) -#define SUPPORT_SYSRQ -#endif - #include <linux/module.h> #include <linux/ioport.h> #include <linux/init.h> @@ -220,9 +216,7 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE)) flg = TTY_FRAME; -#ifdef SUPPORT_SYSRQ sport->port.sysrq = 0; -#endif } if (uart_handle_sysrq_char(&sport->port, ch)) @@ -800,6 +794,7 @@ static int pnx8xxx_serial_probe(struct platform_device *pdev) if (pnx8xxx_ports[i].port.mapbase != res->start) continue; + pnx8xxx_ports[i].port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_PNX8XXX_CONSOLE); pnx8xxx_ports[i].port.dev = &pdev->dev; uart_add_one_port(&pnx8xxx_reg, &pnx8xxx_ports[i].port); platform_set_drvdata(pdev, &pnx8xxx_ports[i]); |