Skip to content

Commit a106848

Browse files
hammerh0314-commitsgregkh
authored andcommitted
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: 9e8d547 ("serial: sunplus-uart: Add Sunplus SoC UART Driver") Reported-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kernel test robot <lkp@intel.com> Tested-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Hammer Hsieh <hammerh0314@gmail.com> Link: https://lore.kernel.org/r/1646108386-29905-1-git-send-email-hammerh0314@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3197906 commit a106848

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/tty/serial/sunplus-uart.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static int sunplus_verify_port(struct uart_port *port, struct serial_struct *ser
441441
return 0;
442442
}
443443

444-
#ifdef CONFIG_SERIAL_SUNPLUS_CONSOLE
444+
#if defined(CONFIG_SERIAL_SUNPLUS_CONSOLE) || defined(CONFIG_CONSOLE_POLL)
445445
static void wait_for_xmitr(struct uart_port *port)
446446
{
447447
unsigned int val;
@@ -562,6 +562,10 @@ static struct console sunplus_uart_console = {
562562
.index = -1,
563563
.data = &sunplus_uart_driver
564564
};
565+
566+
#define SERIAL_SUNPLUS_CONSOLE (&sunplus_uart_console)
567+
#else
568+
#define SERIAL_SUNPLUS_CONSOLE NULL
565569
#endif
566570

567571
static struct uart_driver sunplus_uart_driver = {
@@ -571,7 +575,7 @@ static struct uart_driver sunplus_uart_driver = {
571575
.major = TTY_MAJOR,
572576
.minor = 64,
573577
.nr = SUP_UART_NR,
574-
.cons = &sunplus_uart_console,
578+
.cons = SERIAL_SUNPLUS_CONSOLE,
575579
};
576580

577581
static void sunplus_uart_disable_unprepare(void *data)

0 commit comments

Comments
 (0)