mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH tty-next] serial:sunplus-uart:Fix compile error while CONFIG_SERIAL_SUNPLUS_CONSOLE=n
@ 2022-03-01  4:19 Hammer Hsieh
  2022-03-01  4:42 ` Randy Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Hammer Hsieh @ 2022-03-01  4:19 UTC (permalink / raw)
  To: gregkh, linux-serial, linux-kernel, jirislaby, p.zabel
  Cc: wells.lu, hammer.hsieh, Hammer Hsieh

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: 9e8d547032("serial:sunplus-uart:Fix compile error for SP7021")

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Hammer Hsieh <hammerh0314@gmail.com>
---
 drivers/tty/serial/sunplus-uart.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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)
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH tty-next] serial:sunplus-uart:Fix compile error while CONFIG_SERIAL_SUNPLUS_CONSOLE=n
  2022-03-01  4:19 [PATCH tty-next] serial:sunplus-uart:Fix compile error while CONFIG_SERIAL_SUNPLUS_CONSOLE=n Hammer Hsieh
@ 2022-03-01  4:42 ` Randy Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: Randy Dunlap @ 2022-03-01  4:42 UTC (permalink / raw)
  To: Hammer Hsieh, gregkh, linux-serial, linux-kernel, jirislaby, p.zabel
  Cc: wells.lu, hammer.hsieh



On 2/28/22 20:19, Hammer Hsieh wrote:
> 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: 9e8d547032("serial:sunplus-uart:Fix compile error for SP7021")
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>

Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>

thanks.

> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Hammer Hsieh <hammerh0314@gmail.com>
> ---
>  drivers/tty/serial/sunplus-uart.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> 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)

-- 
~Randy

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-01  4:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01  4:19 [PATCH tty-next] serial:sunplus-uart:Fix compile error while CONFIG_SERIAL_SUNPLUS_CONSOLE=n Hammer Hsieh
2022-03-01  4:42 ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®