Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1307787

[PATCH v4 07/11] serial: earlycon: Common log banner for command line and DT

From Peter Hurley <peter@hurleysoftware.com>
Newsgroups linux.kernel
Subject [PATCH v4 07/11] serial: earlycon: Common log banner for command line and DT
Date 2016-01-12 20:50 +0100
Message-ID <qQd75-5xe-37@gated-at.bofh.it> (permalink)
References <pd2gV-7Bs-3@gated-at.bofh.it> <qQd74-5xe-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Refactor the command line earlycon banner into earlycon_init() so
both earlycon startup methods output an info banner.

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 drivers/tty/serial/earlycon.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index 4182185..10a2ae3 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -62,6 +62,7 @@ static void __init earlycon_init(struct earlycon_device *device,
 				 const char *name)
 {
 	struct console *earlycon = device->con;
+	struct uart_port *port = &device->port;
 	const char *s;
 	size_t len;
 
@@ -75,6 +76,19 @@ static void __init earlycon_init(struct earlycon_device *device,
 	len = s - name;
 	strlcpy(earlycon->name, name, min(len + 1, sizeof(earlycon->name)));
 	earlycon->data = &early_console_dev;
+
+	if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM16 ||
+	    port->iotype == UPIO_MEM32 || port->iotype == UPIO_MEM32BE)
+		pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n",
+			(port->iotype == UPIO_MEM) ? "" :
+			(port->iotype == UPIO_MEM16) ? "16" :
+			(port->iotype == UPIO_MEM32) ? "32" : "32be",
+			(unsigned long long)port->mapbase,
+			device->options);
+	else
+		pr_info("Early serial console at I/O port 0x%lx (options '%s')\n",
+			port->iobase,
+			device->options);
 }
 
 static int __init parse_options(struct earlycon_device *device, char *options)
@@ -113,19 +127,6 @@ static int __init parse_options(struct earlycon_device *device, char *options)
 		strlcpy(device->options, options, length);
 	}
 
-	if (port->iotype == UPIO_MEM || port->iotype == UPIO_MEM16 ||
-	    port->iotype == UPIO_MEM32 || port->iotype == UPIO_MEM32BE)
-		pr_info("Early serial console at MMIO%s 0x%llx (options '%s')\n",
-			(port->iotype == UPIO_MEM) ? "" :
-			(port->iotype == UPIO_MEM16) ? "16" :
-			(port->iotype == UPIO_MEM32) ? "32" : "32be",
-			(unsigned long long)port->mapbase,
-			device->options);
-	else
-		pr_info("Early serial console at I/O port 0x%lx (options '%s')\n",
-			port->iobase,
-			device->options);
-
 	return 0;
 }
 
-- 
2.7.0

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 00/11] Earlycon cleanup Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
  [PATCH v4 08/11] serial: earlycon: Show the earlycon "driver" in banner Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
  [PATCH v4 11/11] serial: 8250_omap: Add omap8250 earlycon Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
    Re: [PATCH v4 11/11] serial: 8250_omap: Add omap8250 earlycon Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 21:00 +0100
      Re: [PATCH v4 11/11] serial: 8250_omap: Add omap8250 earlycon Jon Hunter <jonathanh@nvidia.com> - 2016-01-13 10:30 +0100
        Re: [PATCH v4 11/11] serial: 8250_omap: Add omap8250 earlycon Jon Hunter <jonathanh@nvidia.com> - 2016-01-13 11:00 +0100
        Re: [PATCH v4 11/11] serial: 8250_omap: Add omap8250 earlycon Jon Hunter <jonathanh@nvidia.com> - 2016-01-13 11:20 +0100
          Re: [PATCH v4 11/11] serial: 8250_omap: Add omap8250 earlycon Peter Hurley <peter@hurleysoftware.com> - 2016-01-13 18:10 +0100
            Re: [PATCH v4 11/11] serial: 8250_omap: Add omap8250 earlycon Jon Hunter <jonathanh@nvidia.com> - 2016-01-13 18:20 +0100
  [PATCH v4 10/11] of: earlycon: Log more helpful message if stdout-path node not found Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
    Re: [PATCH v4 10/11] of: earlycon: Log more helpful message if  stdout-path node not found Rob Herring <robh+dt@kernel.org> - 2016-01-13 00:40 +0100
  [PATCH v4 02/11] serial: earlycon: Fixup earlycon console name and index Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
  [PATCH v4 05/11] of: earlycon: Initialize port fields from DT properties Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
    Re: [PATCH v4 05/11] of: earlycon: Initialize port fields from DT properties Rob Herring <robh+dt@kernel.org> - 2016-01-13 01:00 +0100
      Re: [PATCH v4 05/11] of: earlycon: Initialize port fields from DT  properties Peter Hurley <peter@hurleysoftware.com> - 2016-01-13 17:40 +0100
  [PATCH v4 06/11] of: earlycon: Move address translation to of_setup_earlycon() Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
  [PATCH v4 07/11] serial: earlycon: Common log banner for command line and DT Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
  [PATCH v4 09/11] serial: 8250_early: Use port->regshift Peter Hurley <peter@hurleysoftware.com> - 2016-01-12 20:50 +0100
  Re: [PATCH v4 00/11] Earlycon cleanup Rob Herring <robh+dt@kernel.org> - 2016-01-13 01:00 +0100

csiph-web