linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Simek <michal.simek@xilinx.com>
To: linux-kernel@vger.kernel.org, monstr@monstr.eu,
	Alan Cox <gnomes@lxorguk.ukuu.org.uk>
Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	"Jiri Slaby" <jslaby@suse.com>,
	linux-serial@vger.kernel.org,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 1/4] serial: uartps: Remove console_initcall from the driver
Date: Fri, 21 Jul 2017 11:32:24 +0200	[thread overview]
Message-ID: <bd75a2ab5838ae1cf44af667e24be2f02c2e9f3c.1500629544.git.michal.simek@xilinx.com> (raw)
In-Reply-To: <cover.1500629544.git.michal.simek@xilinx.com>
In-Reply-To: <cover.1500629544.git.michal.simek@xilinx.com>

register_console() is called from
uart_add_one_port()->uart_configure_port()
that's why register_console() is called twice.

This patch remove console_initcall to call register_console() only from
one location.

Also based on my tests cdns_uart_console_setup() is not called
from the first register_console() call.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

I am not quite sure about this because console_initcall is called
early but I can see any difference in usage.
pl011 is not calling this but others are doing it.

---
 drivers/tty/serial/xilinx_uartps.c | 14 --------------
 1 file changed, 14 deletions(-)

diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index fde55dcdea5a..4614349403c1 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1298,20 +1298,6 @@ static int __init cdns_uart_console_setup(struct console *co, char *options)
 	.index	= -1, /* Specified on the cmdline (e.g. console=ttyPS ) */
 	.data	= &cdns_uart_uart_driver,
 };
-
-/**
- * cdns_uart_console_init - Initialization call
- *
- * Return: 0 on success, negative errno otherwise
- */
-static int __init cdns_uart_console_init(void)
-{
-	register_console(&cdns_uart_console);
-	return 0;
-}
-
-console_initcall(cdns_uart_console_init);
-
 #endif /* CONFIG_SERIAL_XILINX_PS_UART_CONSOLE */
 
 static struct uart_driver cdns_uart_uart_driver = {
-- 
1.9.1

  reply	other threads:[~2017-07-21  9:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21  9:32 [RFC PATCH 0/4] serial: uartps: Dynamic allocation Michal Simek
2017-07-21  9:32 ` Michal Simek [this message]
2017-07-21 15:47   ` [RFC PATCH 1/4] serial: uartps: Remove console_initcall from the driver Sören Brinkmann
2017-07-31  7:37     ` Michal Simek
2017-07-21  9:32 ` [RFC PATCH 2/4] serial: uartps: Use dynamic array for console port Michal Simek
2017-07-21  9:32 ` [RFC PATCH 3/4] serial: uartps: Move cnds_uart_get_port to probe Michal Simek
2017-07-21  9:32 ` [RFC PATCH 4/4] serial: uartps: Remove static port array Michal Simek
2017-07-28 18:39 ` [RFC PATCH 0/4] serial: uartps: Dynamic allocation Alan Cox
2017-07-31  7:42   ` Michal Simek

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=bd75a2ab5838ae1cf44af667e24be2f02c2e9f3c.1500629544.git.michal.simek@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=monstr@monstr.eu \
    --cc=soren.brinkmann@xilinx.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;
as well as URLs for NNTP newsgroup(s).