From: Hammer Hsieh Date: Tue, 1 Mar 2022 04:19:46 +0000 (+0800) Subject: serial: sunplus-uart: Fix compile error while CONFIG_SERIAL_SUNPLUS_CONSOLE=n X-Git-Tag: v6.1-rc5~1690^2~30 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a106848c42b6a0ed4817008373562a4ab67f9e7e;p=platform%2Fkernel%2Flinux-starfive.git serial: sunplus-uart: Fix compile error while CONFIG_SERIAL_SUNPLUS_CONSOLE=n 1. Fix implicit declaration of function 'wait_for_xmitr' issue. 2. Fix 'sunplus_uart_console' undeclared here issue. 3. Fix use of undeclared identifier 'sunplus_uart_console' issue. Fixes: 9e8d5470325f ("serial: sunplus-uart: Add Sunplus SoC UART Driver") Reported-by: Randy Dunlap Reported-by: kernel test robot Tested-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: Hammer Hsieh Link: https://lore.kernel.org/r/1646108386-29905-1-git-send-email-hammerh0314@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/sunplus-uart.c b/drivers/tty/serial/sunplus-uart.c index 450c8e7..1c7a30b 100644 --- a/drivers/tty/serial/sunplus-uart.c +++ b/drivers/tty/serial/sunplus-uart.c @@ -441,7 +441,7 @@ static int sunplus_verify_port(struct uart_port *port, struct serial_struct *ser return 0; } -#ifdef CONFIG_SERIAL_SUNPLUS_CONSOLE +#if defined(CONFIG_SERIAL_SUNPLUS_CONSOLE) || defined(CONFIG_CONSOLE_POLL) static void wait_for_xmitr(struct uart_port *port) { unsigned int val; @@ -562,6 +562,10 @@ static struct console sunplus_uart_console = { .index = -1, .data = &sunplus_uart_driver }; + +#define SERIAL_SUNPLUS_CONSOLE (&sunplus_uart_console) +#else +#define SERIAL_SUNPLUS_CONSOLE NULL #endif static struct uart_driver sunplus_uart_driver = { @@ -571,7 +575,7 @@ static struct uart_driver sunplus_uart_driver = { .major = TTY_MAJOR, .minor = 64, .nr = SUP_UART_NR, - .cons = &sunplus_uart_console, + .cons = SERIAL_SUNPLUS_CONSOLE, }; static void sunplus_uart_disable_unprepare(void *data)