Commit e163d1f4 authored by Vineet Gupta's avatar Vineet Gupta Committed by Greg Kroah-Hartman

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: default avatarVineet 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: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 026bb292
...@@ -651,7 +651,7 @@ static struct __initdata console arc_early_serial_console = { ...@@ -651,7 +651,7 @@ static struct __initdata console arc_early_serial_console = {
.index = -1 .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 dev_id = pdev->id < 0 ? 0 : pdev->id;
int rc; int rc;
...@@ -667,20 +667,12 @@ static int arc_serial_probe_earlyprintk(struct platform_device *pdev) ...@@ -667,20 +667,12 @@ static int arc_serial_probe_earlyprintk(struct platform_device *pdev)
register_console(&arc_early_serial_console); register_console(&arc_early_serial_console);
return 0; return 0;
} }
#else
static int arc_serial_probe_earlyprintk(struct platform_device *pdev)
{
return -ENODEV;
}
#endif /* CONFIG_SERIAL_ARC_CONSOLE */ #endif /* CONFIG_SERIAL_ARC_CONSOLE */
static int arc_serial_probe(struct platform_device *pdev) static int arc_serial_probe(struct platform_device *pdev)
{ {
int rc, dev_id; int rc, dev_id;
if (is_early_platform_device(pdev))
return arc_serial_probe_earlyprintk(pdev);
dev_id = pdev->id < 0 ? 0 : pdev->id; dev_id = pdev->id < 0 ? 0 : pdev->id;
rc = arc_uart_init_one(pdev, dev_id); rc = arc_uart_init_one(pdev, dev_id);
if (rc) if (rc)
...@@ -706,6 +698,15 @@ static struct platform_driver arc_platform_driver = { ...@@ -706,6 +698,15 @@ static struct platform_driver arc_platform_driver = {
}; };
#ifdef CONFIG_SERIAL_ARC_CONSOLE #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. * Register an early platform driver of "earlyprintk" class.
* ARCH platform code installs the driver and probes the early devices * ARCH platform code installs the driver and probes the early devices
...@@ -713,7 +714,7 @@ static struct platform_driver arc_platform_driver = { ...@@ -713,7 +714,7 @@ static struct platform_driver arc_platform_driver = {
* or it could be done independently, for all "earlyprintk" class drivers. * or it could be done independently, for all "earlyprintk" class drivers.
* [see arch/arc/plat-arcfpga/platform.c] * [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 */ #endif /* CONFIG_SERIAL_ARC_CONSOLE */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment