Commit aa3479d2 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Greg Kroah-Hartman
Browse files

tty/serial: Migrate imx 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: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: default avatarDmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-20-dima@arista.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4d9ec1c0
Loading
Loading
Loading
Loading
+1 −6
Original line number Original line Diff line number Diff line
@@ -8,10 +8,6 @@
 * Copyright (C) 2004 Pengutronix
 * Copyright (C) 2004 Pengutronix
 */
 */


#if defined(CONFIG_SERIAL_IMX_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
#define SUPPORT_SYSRQ
#endif

#include <linux/module.h>
#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/init.h>
@@ -779,9 +775,7 @@ static irqreturn_t imx_uart_rxint(int irq, void *dev_id)
			if (rx & URXD_OVRRUN)
			if (rx & URXD_OVRRUN)
				flg = TTY_OVERRUN;
				flg = TTY_OVERRUN;


#ifdef SUPPORT_SYSRQ
			sport->port.sysrq = 0;
			sport->port.sysrq = 0;
#endif
		}
		}


		if (sport->port.ignore_status_mask & URXD_DUMMY_READ)
		if (sport->port.ignore_status_mask & URXD_DUMMY_READ)
@@ -2231,6 +2225,7 @@ static int imx_uart_probe(struct platform_device *pdev)
	sport->port.iotype = UPIO_MEM;
	sport->port.iotype = UPIO_MEM;
	sport->port.irq = rxirq;
	sport->port.irq = rxirq;
	sport->port.fifosize = 32;
	sport->port.fifosize = 32;
	sport->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_IMX_CONSOLE);
	sport->port.ops = &imx_uart_pops;
	sport->port.ops = &imx_uart_pops;
	sport->port.rs485_config = imx_uart_rs485_config;
	sport->port.rs485_config = imx_uart_rs485_config;
	sport->port.flags = UPF_BOOT_AUTOCONF;
	sport->port.flags = UPF_BOOT_AUTOCONF;