From: Vineet Gupta <Vineet.Gupta1@synopsys.com>
To: <linux-serial@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>,
Alan Cox <alan@linux.intel.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.cz>
Subject: [PATCH 2/4] serial/arc-uart: split probe from probe_earlyprintk
Date: Fri, 11 Jan 2013 11:50:21 +0530 [thread overview]
Message-ID: <1357885223-19243-3-git-send-email-vgupta@synopsys.com> (raw)
In-Reply-To: <1357885223-19243-1-git-send-email-vgupta@synopsys.com>
This is in preparation for devicetree based probing, where earlyprintk
won't have access to DT serial aliases which the normal probe would
absolutely rely on.
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: linux-serial@vger.kernel.org
---
drivers/tty/serial/arc_uart.c | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
index 8089dc3..9de26ba 100644
--- a/drivers/tty/serial/arc_uart.c
+++ b/drivers/tty/serial/arc_uart.c
@@ -651,7 +651,7 @@ static struct __initdata console arc_early_serial_console = {
.index = -1
};
-static int arc_serial_probe_earlyprintk(struct platform_device *pdev)
+static int __init arc_serial_probe_earlyprintk(struct platform_device *pdev)
{
int dev_id = pdev->id < 0 ? 0 : pdev->id;
int rc;
@@ -667,20 +667,12 @@ static int arc_serial_probe_earlyprintk(struct platform_device *pdev)
register_console(&arc_early_serial_console);
return 0;
}
-#else
-static int arc_serial_probe_earlyprintk(struct platform_device *pdev)
-{
- return -ENODEV;
-}
#endif /* CONFIG_SERIAL_ARC_CONSOLE */
static int arc_serial_probe(struct platform_device *pdev)
{
int rc, dev_id;
- if (is_early_platform_device(pdev))
- return arc_serial_probe_earlyprintk(pdev);
-
dev_id = pdev->id < 0 ? 0 : pdev->id;
rc = arc_uart_init_one(pdev, dev_id);
if (rc)
@@ -706,6 +698,15 @@ static struct platform_driver arc_platform_driver = {
};
#ifdef CONFIG_SERIAL_ARC_CONSOLE
+
+static struct platform_driver early_arc_platform_driver = {
+ .probe = arc_serial_probe_earlyprintk,
+ .remove = arc_serial_remove,
+ .driver = {
+ .name = DRIVER_NAME,
+ .owner = THIS_MODULE,
+ },
+};
/*
* Register an early platform driver of "earlyprintk" class.
* ARCH platform code installs the driver and probes the early devices
@@ -713,7 +714,7 @@ static struct platform_driver arc_platform_driver = {
* or it could be done independently, for all "earlyprintk" class drivers.
* [see arch/arc/plat-arcfpga/platform.c]
*/
-early_platform_init("earlyprintk", &arc_platform_driver);
+early_platform_init("earlyprintk", &early_arc_platform_driver);
#endif /* CONFIG_SERIAL_ARC_CONSOLE */
--
1.7.4.1
next prev parent reply other threads:[~2013-01-11 6:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-11 6:20 [PATCH 0/4] switch arc-uart to devicetree based probing Vineet Gupta
2013-01-11 6:20 ` [PATCH 1/4] serial/arc-uart: Don't index with -ve platform_device->id Vineet Gupta
2013-01-11 6:20 ` Vineet Gupta [this message]
2013-01-11 6:20 ` [PATCH 3/4] serial/arc-uart: platform_data order changed Vineet Gupta
2013-01-11 6:20 ` [PATCH 4/4] serial/arc-uart: switch to devicetree based probing Vineet Gupta
2013-01-11 11:33 ` Arnd Bergmann
2013-01-11 11:55 ` Vineet Gupta
2013-01-11 20:17 ` Arnd Bergmann
2013-02-08 23:01 ` Grant Likely
2013-02-09 6:45 ` Vineet Gupta
2013-02-09 9:28 ` Arnd Bergmann
[not found] ` <1360572101-12744-1-git-send-email-vgupta@synopsys.com>
2013-02-11 8:41 ` [PATCH] serial/arc-uart: Miscll DT related updates (Grant's review comments) Vineet Gupta
2013-02-13 20:47 ` [PATCH 4/4] serial/arc-uart: switch to devicetree based probing Grant Likely
2013-01-16 6:16 ` [PATCH 0/4] switch arc-uart " Greg KH
2013-01-16 6:16 ` Vineet Gupta
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=1357885223-19243-3-git-send-email-vgupta@synopsys.com \
--to=vineet.gupta1@synopsys.com \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/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).