mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hammer Hsieh <hammerh0314@gmail.com>
To: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org, jirislaby@kernel.org,
	p.zabel@pengutronix.de
Cc: wells.lu@sunplus.com, hammer.hsieh@sunplus.com,
	Hammer Hsieh <hammerh0314@gmail.com>
Subject: [PATCH tty-next] serial:sunplus-uart:Fix compile error while CONFIG_SERIAL_SUNPLUS_CONSOLE=n
Date: Tue,  1 Mar 2022 12:19:46 +0800	[thread overview]
Message-ID: <1646108386-29905-1-git-send-email-hammerh0314@gmail.com> (raw)

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


             reply	other threads:[~2022-03-01  4:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-01  4:19 Hammer Hsieh [this message]
2022-03-01  4:42 ` Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1646108386-29905-1-git-send-email-hammerh0314@gmail.com \
    --to=hammerh0314@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hammer.hsieh@sunplus.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=wells.lu@sunplus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®