All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] earlycon: Fix uart_parse_earlycon() if !CONFIG_SERIAL_CORE_CONSOLE
@ 2015-04-11 14:42 ` Peter Hurley
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Hurley @ 2015-04-11 14:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Jiri Slaby, linux-serial, linux-kernel, linux-arm-kernel,
	Alim Akhtar, Marek Szyprowski, tfiga, Chanwoo Choi,
	Arnd Bergmann, Peter Hurley

Arnd Bergmann wrote:
> A configuration that enables earlycon but not the core console
> code causes a link error:
>
> drivers/built-in.o: In function `setup_earlycon':
> drivers/tty/serial/earlycon.c:70: undefined reference to `uart_parse_earlycon'

CONFIG_SERIAL_EARLYCON should not require CONFIG_SERIAL_CORE_CONSOLE.
Move uart_parse_earlycon() and compile if either CONFIG_SERIAL_CORE_CONSOLE
or CONFIG_SERIAL_EARLYCON.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---

NB: The diff moves everything else around uart_parse_earlycon() :/

 drivers/tty/serial/serial_core.c | 90 ++++++++++++++++++++--------------------
 1 file changed, 46 insertions(+), 44 deletions(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index eec067d..4d42b13 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1762,50 +1762,7 @@ static const struct file_operations uart_proc_fops = {
 };
 #endif
 
-#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_CONSOLE_POLL)
-/**
- *	uart_console_write - write a console message to a serial port
- *	@port: the port to write the message
- *	@s: array of characters
- *	@count: number of characters in string to write
- *	@putchar: function to write character to port
- */
-void uart_console_write(struct uart_port *port, const char *s,
-			unsigned int count,
-			void (*putchar)(struct uart_port *, int))
-{
-	unsigned int i;
-
-	for (i = 0; i < count; i++, s++) {
-		if (*s == '\n')
-			putchar(port, '\r');
-		putchar(port, *s);
-	}
-}
-EXPORT_SYMBOL_GPL(uart_console_write);
-
-/*
- *	Check whether an invalid uart number has been specified, and
- *	if so, search for the first available port that does have
- *	console support.
- */
-struct uart_port * __init
-uart_get_console(struct uart_port *ports, int nr, struct console *co)
-{
-	int idx = co->index;
-
-	if (idx < 0 || idx >= nr || (ports[idx].iobase == 0 &&
-				     ports[idx].membase == NULL))
-		for (idx = 0; idx < nr; idx++)
-			if (ports[idx].iobase != 0 ||
-			    ports[idx].membase != NULL)
-				break;
-
-	co->index = idx;
-
-	return ports + idx;
-}
-
+#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_SERIAL_EARLYCON)
 /**
  *	uart_parse_earlycon - Parse earlycon options
  *	@p:	  ptr to 2nd field (ie., just beyond '<name>,')
@@ -1851,6 +1808,51 @@ int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
 	return 0;
 }
 EXPORT_SYMBOL_GPL(uart_parse_earlycon);
+#endif
+
+#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_CONSOLE_POLL)
+/**
+ *	uart_console_write - write a console message to a serial port
+ *	@port: the port to write the message
+ *	@s: array of characters
+ *	@count: number of characters in string to write
+ *	@putchar: function to write character to port
+ */
+void uart_console_write(struct uart_port *port, const char *s,
+			unsigned int count,
+			void (*putchar)(struct uart_port *, int))
+{
+	unsigned int i;
+
+	for (i = 0; i < count; i++, s++) {
+		if (*s == '\n')
+			putchar(port, '\r');
+		putchar(port, *s);
+	}
+}
+EXPORT_SYMBOL_GPL(uart_console_write);
+
+/*
+ *	Check whether an invalid uart number has been specified, and
+ *	if so, search for the first available port that does have
+ *	console support.
+ */
+struct uart_port * __init
+uart_get_console(struct uart_port *ports, int nr, struct console *co)
+{
+	int idx = co->index;
+
+	if (idx < 0 || idx >= nr || (ports[idx].iobase == 0 &&
+				     ports[idx].membase == NULL))
+		for (idx = 0; idx < nr; idx++)
+			if (ports[idx].iobase != 0 ||
+			    ports[idx].membase != NULL)
+				break;
+
+	co->index = idx;
+
+	return ports + idx;
+}
 
 /**
  *	uart_parse_options - Parse serial port baud/parity/bits/flow control.
-- 
2.3.5


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

* [PATCH] earlycon: Fix uart_parse_earlycon() if !CONFIG_SERIAL_CORE_CONSOLE
@ 2015-04-11 14:42 ` Peter Hurley
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Hurley @ 2015-04-11 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

Arnd Bergmann wrote:
> A configuration that enables earlycon but not the core console
> code causes a link error:
>
> drivers/built-in.o: In function `setup_earlycon':
> drivers/tty/serial/earlycon.c:70: undefined reference to `uart_parse_earlycon'

CONFIG_SERIAL_EARLYCON should not require CONFIG_SERIAL_CORE_CONSOLE.
Move uart_parse_earlycon() and compile if either CONFIG_SERIAL_CORE_CONSOLE
or CONFIG_SERIAL_EARLYCON.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---

NB: The diff moves everything else around uart_parse_earlycon() :/

 drivers/tty/serial/serial_core.c | 90 ++++++++++++++++++++--------------------
 1 file changed, 46 insertions(+), 44 deletions(-)

diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index eec067d..4d42b13 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1762,50 +1762,7 @@ static const struct file_operations uart_proc_fops = {
 };
 #endif
 
-#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_CONSOLE_POLL)
-/**
- *	uart_console_write - write a console message to a serial port
- *	@port: the port to write the message
- *	@s: array of characters
- *	@count: number of characters in string to write
- *	@putchar: function to write character to port
- */
-void uart_console_write(struct uart_port *port, const char *s,
-			unsigned int count,
-			void (*putchar)(struct uart_port *, int))
-{
-	unsigned int i;
-
-	for (i = 0; i < count; i++, s++) {
-		if (*s == '\n')
-			putchar(port, '\r');
-		putchar(port, *s);
-	}
-}
-EXPORT_SYMBOL_GPL(uart_console_write);
-
-/*
- *	Check whether an invalid uart number has been specified, and
- *	if so, search for the first available port that does have
- *	console support.
- */
-struct uart_port * __init
-uart_get_console(struct uart_port *ports, int nr, struct console *co)
-{
-	int idx = co->index;
-
-	if (idx < 0 || idx >= nr || (ports[idx].iobase == 0 &&
-				     ports[idx].membase == NULL))
-		for (idx = 0; idx < nr; idx++)
-			if (ports[idx].iobase != 0 ||
-			    ports[idx].membase != NULL)
-				break;
-
-	co->index = idx;
-
-	return ports + idx;
-}
-
+#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_SERIAL_EARLYCON)
 /**
  *	uart_parse_earlycon - Parse earlycon options
  *	@p:	  ptr to 2nd field (ie., just beyond '<name>,')
@@ -1851,6 +1808,51 @@ int uart_parse_earlycon(char *p, unsigned char *iotype, unsigned long *addr,
 	return 0;
 }
 EXPORT_SYMBOL_GPL(uart_parse_earlycon);
+#endif
+
+#if defined(CONFIG_SERIAL_CORE_CONSOLE) || defined(CONFIG_CONSOLE_POLL)
+/**
+ *	uart_console_write - write a console message to a serial port
+ *	@port: the port to write the message
+ *	@s: array of characters
+ *	@count: number of characters in string to write
+ *	@putchar: function to write character to port
+ */
+void uart_console_write(struct uart_port *port, const char *s,
+			unsigned int count,
+			void (*putchar)(struct uart_port *, int))
+{
+	unsigned int i;
+
+	for (i = 0; i < count; i++, s++) {
+		if (*s == '\n')
+			putchar(port, '\r');
+		putchar(port, *s);
+	}
+}
+EXPORT_SYMBOL_GPL(uart_console_write);
+
+/*
+ *	Check whether an invalid uart number has been specified, and
+ *	if so, search for the first available port that does have
+ *	console support.
+ */
+struct uart_port * __init
+uart_get_console(struct uart_port *ports, int nr, struct console *co)
+{
+	int idx = co->index;
+
+	if (idx < 0 || idx >= nr || (ports[idx].iobase == 0 &&
+				     ports[idx].membase == NULL))
+		for (idx = 0; idx < nr; idx++)
+			if (ports[idx].iobase != 0 ||
+			    ports[idx].membase != NULL)
+				break;
+
+	co->index = idx;
+
+	return ports + idx;
+}
 
 /**
  *	uart_parse_options - Parse serial port baud/parity/bits/flow control.
-- 
2.3.5

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

* Re: [PATCH] earlycon: Fix uart_parse_earlycon() if !CONFIG_SERIAL_CORE_CONSOLE
  2015-04-11 14:42 ` Peter Hurley
@ 2015-04-28 12:22   ` Greg Kroah-Hartman
  -1 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-04-28 12:22 UTC (permalink / raw)
  To: Peter Hurley
  Cc: Jiri Slaby, linux-serial, linux-kernel, linux-arm-kernel,
	Alim Akhtar, Marek Szyprowski, tfiga, Chanwoo Choi,
	Arnd Bergmann

On Sat, Apr 11, 2015 at 10:42:36AM -0400, Peter Hurley wrote:
> Arnd Bergmann wrote:
> > A configuration that enables earlycon but not the core console
> > code causes a link error:
> >
> > drivers/built-in.o: In function `setup_earlycon':
> > drivers/tty/serial/earlycon.c:70: undefined reference to `uart_parse_earlycon'
> 
> CONFIG_SERIAL_EARLYCON should not require CONFIG_SERIAL_CORE_CONSOLE.
> Move uart_parse_earlycon() and compile if either CONFIG_SERIAL_CORE_CONSOLE
> or CONFIG_SERIAL_EARLYCON.
> 
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
> ---
> 
> NB: The diff moves everything else around uart_parse_earlycon() :/
> 
>  drivers/tty/serial/serial_core.c | 90 ++++++++++++++++++++--------------------
>  1 file changed, 46 insertions(+), 44 deletions(-)

This doesn't apply to my tty-next branch :(

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

* [PATCH] earlycon: Fix uart_parse_earlycon() if !CONFIG_SERIAL_CORE_CONSOLE
@ 2015-04-28 12:22   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2015-04-28 12:22 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Apr 11, 2015 at 10:42:36AM -0400, Peter Hurley wrote:
> Arnd Bergmann wrote:
> > A configuration that enables earlycon but not the core console
> > code causes a link error:
> >
> > drivers/built-in.o: In function `setup_earlycon':
> > drivers/tty/serial/earlycon.c:70: undefined reference to `uart_parse_earlycon'
> 
> CONFIG_SERIAL_EARLYCON should not require CONFIG_SERIAL_CORE_CONSOLE.
> Move uart_parse_earlycon() and compile if either CONFIG_SERIAL_CORE_CONSOLE
> or CONFIG_SERIAL_EARLYCON.
> 
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
> ---
> 
> NB: The diff moves everything else around uart_parse_earlycon() :/
> 
>  drivers/tty/serial/serial_core.c | 90 ++++++++++++++++++++--------------------
>  1 file changed, 46 insertions(+), 44 deletions(-)

This doesn't apply to my tty-next branch :(

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

end of thread, other threads:[~2015-04-28 12:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-11 14:42 [PATCH] earlycon: Fix uart_parse_earlycon() if !CONFIG_SERIAL_CORE_CONSOLE Peter Hurley
2015-04-11 14:42 ` Peter Hurley
2015-04-28 12:22 ` Greg Kroah-Hartman
2015-04-28 12:22   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.