Commit 5f99fca9 authored by Dmitry Safonov's avatar Dmitry Safonov Committed by Greg Kroah-Hartman

tty/serial: Migrate amba-pl01* 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: Russell King <linux@armlinux.org.uk>
Signed-off-by: default avatarDmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-10-dima@arista.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4225eb0a
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
* and hooked into this driver. * and hooked into this driver.
*/ */
#if defined(CONFIG_SERIAL_AMBA_PL010_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>
...@@ -728,6 +724,7 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id) ...@@ -728,6 +724,7 @@ static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
uap->port.iotype = UPIO_MEM; uap->port.iotype = UPIO_MEM;
uap->port.irq = dev->irq[0]; uap->port.irq = dev->irq[0];
uap->port.fifosize = 16; uap->port.fifosize = 16;
uap->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_AMBA_PL010_CONSOLE);
uap->port.ops = &amba_pl010_pops; uap->port.ops = &amba_pl010_pops;
uap->port.flags = UPF_BOOT_AUTOCONF; uap->port.flags = UPF_BOOT_AUTOCONF;
uap->port.line = i; uap->port.line = i;
......
...@@ -16,11 +16,6 @@ ...@@ -16,11 +16,6 @@
* and hooked into this driver. * and hooked into this driver.
*/ */
#if defined(CONFIG_SERIAL_AMBA_PL011_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>
...@@ -2577,6 +2572,7 @@ static int pl011_setup_port(struct device *dev, struct uart_amba_port *uap, ...@@ -2577,6 +2572,7 @@ static int pl011_setup_port(struct device *dev, struct uart_amba_port *uap,
uap->port.mapbase = mmiobase->start; uap->port.mapbase = mmiobase->start;
uap->port.membase = base; uap->port.membase = base;
uap->port.fifosize = uap->fifosize; uap->port.fifosize = uap->fifosize;
uap->port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_AMBA_PL011_CONSOLE);
uap->port.flags = UPF_BOOT_AUTOCONF; uap->port.flags = UPF_BOOT_AUTOCONF;
uap->port.line = index; uap->port.line = index;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment