Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty/serial: Migrate msm_serial 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: Andy Gross <agross@kernel.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-arm-msm@vger.kernel.org
Signed-off-by: Dmitry Safonov <dima@arista.com>
Link: https://lore.kernel.org/r/20191213000657.931618-26-dima@arista.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Dmitry Safonov and committed by
Greg Kroah-Hartman
804ca1df 7cbfd6a0

+1 -4
+1 -4
drivers/tty/serial/msm_serial.c
··· 7 7 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. 8 8 */ 9 9 10 - #if defined(CONFIG_SERIAL_MSM_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) 11 - # define SUPPORT_SYSRQ 12 - #endif 13 - 14 10 #include <linux/kernel.h> 15 11 #include <linux/atomic.h> 16 12 #include <linux/dma-mapping.h> ··· 1797 1801 if (unlikely(irq < 0)) 1798 1802 return -ENXIO; 1799 1803 port->irq = irq; 1804 + port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_MSM_CONSOLE); 1800 1805 1801 1806 platform_set_drvdata(pdev, port); 1802 1807