From fd6dbe4e7949d17317b57465bb1e9ed7cd18051a Mon Sep 17 00:00:00 2001 From: Dmitry Safonov Date: Fri, 13 Dec 2019 00:06:31 +0000 Subject: 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 Link: https://lore.kernel.org/r/20191213000657.931618-33-dima@arista.com Signed-off-by: Greg Kroah-Hartman --- drivers/tty/serial/pnx8xxx_uart.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/tty/serial/pnx8xxx_uart.c') 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 #include #include @@ -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]); -- cgit v1.2.3