summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2006-01-18 09:54:29 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-18 09:54:29 +0000
commitbc965a7f43d3fc37584f9c16c6d7a84a911a9d9c (patch)
tree9d7ac6b356c9a884941b374555cebb5d3f465d61 /drivers
parent7eb9b2f56c9812d03ac63031869bcc42151067b1 (diff)
[SERIAL] Fix serial8250 driver initialisation ordering
Commit 7493a314cb83797ce612a577475aacaedc553fed changed the ordering of the registration of the platform device driver vs the 8250 drivers internal initialisation. This led to the probe function being called before the driver had finished its internal initialisation, causing mayhem. Revert the ordering change. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/8250.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index d9ce8c549416..bc36edff2058 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2595,15 +2595,11 @@ static int __init serial8250_init(void)
if (ret)
goto out;
- ret = platform_driver_register(&serial8250_isa_driver);
- if (ret)
- goto unreg_uart_drv;
-
serial8250_isa_devs = platform_device_alloc("serial8250",
PLAT8250_DEV_LEGACY);
if (!serial8250_isa_devs) {
ret = -ENOMEM;
- goto unreg_plat_drv;
+ goto unreg_uart_drv;
}
ret = platform_device_add(serial8250_isa_devs);
@@ -2612,12 +2608,13 @@ static int __init serial8250_init(void)
serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev);
- goto out;
+ ret = platform_driver_register(&serial8250_isa_driver);
+ if (ret == 0)
+ goto out;
+ platform_device_del(serial8250_isa_devs);
put_dev:
platform_device_put(serial8250_isa_devs);
- unreg_plat_drv:
- platform_driver_unregister(&serial8250_isa_driver);
unreg_uart_drv:
uart_unregister_driver(&serial8250_reg);
out: