From 59431dbdaa2ec9b3b296bc5cf6ef3107a1d65420 Mon Sep 17 00:00:00 2001 From: Mukesh Kumar Savaliya Date: Fri, 28 Feb 2020 04:18:31 +0530 Subject: [PATCH 1/2] serial: msm_geni_serial: Use IS_ENABLED() instead of ifdef CONFIG The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either built-in or as a module, use that macro instead of open coding the same. Change-Id: I20ba557462b3080483e60ffd68a2e50d79468135 Signed-off-by: Mukesh Kumar Savaliya --- drivers/tty/serial/msm_geni_serial.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/msm_geni_serial.c b/drivers/tty/serial/msm_geni_serial.c index 4e16a5fe8590..28014d0e904b 100644 --- a/drivers/tty/serial/msm_geni_serial.c +++ b/drivers/tty/serial/msm_geni_serial.c @@ -709,7 +709,8 @@ static void msm_geni_serial_poll_put_char(struct uart_port *uport, } #endif -#if defined(CONFIG_SERIAL_MSM_GENI_CONSOLE) || defined(CONFIG_CONSOLE_POLL) +#if IS_ENABLED(CONFIG_SERIAL_MSM_GENI_CONSOLE) || \ + IS_ENABLED(CONFIG_CONSOLE_POLL) static void msm_geni_serial_wr_char(struct uart_port *uport, int ch) { geni_write_reg_nolog(ch, uport->membase, SE_GENI_TX_FIFOn); @@ -2212,8 +2213,9 @@ static ssize_t ver_info_show(struct device *dev, } static DEVICE_ATTR_RO(ver_info); -#if defined(CONFIG_SERIAL_MSM_GENI_CONSOLE) || defined(CONFIG_CONSOLE_POLL) -static int msm_geni_console_setup(struct console *co, char *options) +#if IS_ENABLED(CONFIG_SERIAL_MSM_GENI_CONSOLE) || \ + IS_ENABLED(CONFIG_CONSOLE_POLL) +static int __init msm_geni_console_setup(struct console *co, char *options) { struct uart_port *uport; struct msm_geni_serial_port *dev_port; @@ -2406,7 +2408,8 @@ static const struct uart_ops msm_geni_serial_pops = { }; static const struct of_device_id msm_geni_device_tbl[] = { -#if defined(CONFIG_SERIAL_MSM_GENI_CONSOLE) || defined(CONFIG_CONSOLE_POLL) +#if IS_ENABLED(CONFIG_SERIAL_MSM_GENI_CONSOLE) || \ + IS_ENABLED(CONFIG_CONSOLE_POLL) { .compatible = "qcom,msm-geni-console", .data = (void *)&msm_geni_console_driver}, #endif From a04fe2a08f85419c928d2230337616845c3ddbad Mon Sep 17 00:00:00 2001 From: Prudhvi Yarlagadda Date: Wed, 18 Mar 2020 18:02:47 +0530 Subject: [PATCH 2/2] msm_geni_serial_console: Make early console depend on kernel console Make early console depend on kernel console from the Kconfig so that early console will be up only when kernel console is either enabled (y) or a module (m). Change-Id: Id480e39c55f18eb5d3b3175c9bf76fa0cc05174f Signed-off-by: Prudhvi Yarlagadda --- drivers/tty/serial/Kconfig | 11 +++++++++-- drivers/tty/serial/Makefile | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig index 3ec80e46aa20..5da29e7a674a 100644 --- a/drivers/tty/serial/Kconfig +++ b/drivers/tty/serial/Kconfig @@ -977,11 +977,18 @@ config SERIAL_MSM_GENI hardware. The driver supports console and High speed UART functions. +config SERIAL_MSM_GENI_EARLY_CONSOLE + bool "MSM on-chip GENI HW based early console support" + help + Serial early console driver for Qualcomm Technologies Inc's GENI + based QUP hardware. + config SERIAL_MSM_GENI_CONSOLE - bool "MSM on-chip GENI HW based console support" - depends on SERIAL_MSM_GENI=y + tristate "MSM on-chip GENI HW based console support" + depends on SERIAL_MSM_GENI select SERIAL_CORE_CONSOLE select SERIAL_EARLYCON + select SERIAL_MSM_GENI_EARLY_CONSOLE help Serial console driver for Qualcomm Technologies Inc's GENI based QUP hardware. diff --git a/drivers/tty/serial/Makefile b/drivers/tty/serial/Makefile index 0a20af944d9c..7cef3897a878 100644 --- a/drivers/tty/serial/Makefile +++ b/drivers/tty/serial/Makefile @@ -56,7 +56,7 @@ obj-$(CONFIG_SERIAL_ATMEL) += atmel_serial.o obj-$(CONFIG_SERIAL_UARTLITE) += uartlite.o obj-$(CONFIG_SERIAL_MSM) += msm_serial.o obj-$(CONFIG_SERIAL_MSM_GENI) += msm_geni_serial.o -obj-$(CONFIG_SERIAL_MSM_GENI_CONSOLE) += msm_geni_serial_console.o +obj-$(CONFIG_SERIAL_MSM_GENI_EARLY_CONSOLE) += msm_geni_serial_console.o obj-$(CONFIG_SERIAL_KS8695) += serial_ks8695.o obj-$(CONFIG_SERIAL_OMAP) += omap-serial.o obj-$(CONFIG_SERIAL_ALTERA_UART) += altera_uart.o