aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVineet Gupta <Vineet.Gupta1@synopsys.com>2013-01-11 01:20:21 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-16 01:15:17 -0500
commite163d1f42bc2089efae58b4966287c4d3504d4c7 (patch)
tree5ad4a58b6c1d13bb95669d88316c944bbd97f25c
parent026bb292c4018dd77186dee1fcb73c9067e69b89 (diff)
serial/arc-uart: split probe from probe_earlyprintk
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: Jiri Slaby <jslaby@suse.cz> Cc: linux-serial@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/arc_uart.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/tty/serial/arc_uart.c b/drivers/tty/serial/arc_uart.c
index 8089dc355ac5..9de26ba48d20 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 = {
651 .index = -1 651 .index = -1
652}; 652};
653 653
654static int arc_serial_probe_earlyprintk(struct platform_device *pdev) 654static int __init arc_serial_probe_earlyprintk(struct platform_device *pdev)
655{ 655{
656 int dev_id = pdev->id < 0 ? 0 : pdev->id; 656 int dev_id = pdev->id < 0 ? 0 : pdev->id;
657 int rc; 657 int rc;
@@ -667,20 +667,12 @@ static int arc_serial_probe_earlyprintk(struct platform_device *pdev)
667 register_console(&arc_early_serial_console); 667 register_console(&arc_early_serial_console);
668 return 0; 668 return 0;
669} 669}
670#else
671static int arc_serial_probe_earlyprintk(struct platform_device *pdev)
672{
673 return -ENODEV;
674}
675#endif /* CONFIG_SERIAL_ARC_CONSOLE */ 670#endif /* CONFIG_SERIAL_ARC_CONSOLE */
676 671
677static int arc_serial_probe(struct platform_device *pdev) 672static int arc_serial_probe(struct platform_device *pdev)
678{ 673{
679 int rc, dev_id; 674 int rc, dev_id;
680 675
681 if (is_early_platform_device(pdev))
682 return arc_serial_probe_earlyprintk(pdev);
683
684 dev_id = pdev->id < 0 ? 0 : pdev->id; 676 dev_id = pdev->id < 0 ? 0 : pdev->id;
685 rc = arc_uart_init_one(pdev, dev_id); 677 rc = arc_uart_init_one(pdev, dev_id);
686 if (rc) 678 if (rc)
@@ -706,6 +698,15 @@ static struct platform_driver arc_platform_driver = {
706}; 698};
707 699
708#ifdef CONFIG_SERIAL_ARC_CONSOLE 700#ifdef CONFIG_SERIAL_ARC_CONSOLE
701
702static struct platform_driver early_arc_platform_driver = {
703 .probe = arc_serial_probe_earlyprintk,
704 .remove = arc_serial_remove,
705 .driver = {
706 .name = DRIVER_NAME,
707 .owner = THIS_MODULE,
708 },
709};
709/* 710/*
710 * Register an early platform driver of "earlyprintk" class. 711 * Register an early platform driver of "earlyprintk" class.
711 * ARCH platform code installs the driver and probes the early devices 712 * ARCH platform code installs the driver and probes the early devices
@@ -713,7 +714,7 @@ static struct platform_driver arc_platform_driver = {
713 * or it could be done independently, for all "earlyprintk" class drivers. 714 * or it could be done independently, for all "earlyprintk" class drivers.
714 * [see arch/arc/plat-arcfpga/platform.c] 715 * [see arch/arc/plat-arcfpga/platform.c]
715 */ 716 */
716early_platform_init("earlyprintk", &arc_platform_driver); 717early_platform_init("earlyprintk", &early_arc_platform_driver);
717 718
718#endif /* CONFIG_SERIAL_ARC_CONSOLE */ 719#endif /* CONFIG_SERIAL_ARC_CONSOLE */
719 720