mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-15 15:04:27 +08:00
tty/serial: Migrate aspeed_vuart 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: Joel Stanley <joel@jms.id.au> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-aspeed@lists.ozlabs.org Signed-off-by: Dmitry Safonov <dima@arista.com> Acked-by: Andrew Jeffery <andrew@aj.id.au> Link: https://lore.kernel.org/r/20191213000657.931618-5-dima@arista.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
1997e9dfdc
commit
9b614afe6c
@ -5,10 +5,6 @@
|
||||
* Copyright (C) 2016 Jeremy Kerr <jk@ozlabs.org>, IBM Corp.
|
||||
* Copyright (C) 2006 Arnd Bergmann <arnd@arndb.de>, IBM Corp.
|
||||
*/
|
||||
#if defined(CONFIG_SERIAL_8250_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
|
||||
#define SUPPORT_SYSRQ
|
||||
#endif
|
||||
|
||||
#include <linux/device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of_address.h>
|
||||
@ -406,6 +402,7 @@ static int aspeed_vuart_probe(struct platform_device *pdev)
|
||||
port.port.unthrottle = aspeed_vuart_unthrottle;
|
||||
port.port.status = UPSTAT_SYNC_FIFO;
|
||||
port.port.dev = &pdev->dev;
|
||||
port.port.has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE);
|
||||
|
||||
rc = sysfs_create_group(&vuart->dev->kobj, &aspeed_vuart_attr_group);
|
||||
if (rc < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user