From: Tony Lindgren Date: Tue, 17 Jan 2006 02:38:27 +0000 (-0800) Subject: Fix for [patch 6/6] serial8250: convert to the new platform device interface X-Git-Tag: v2.6.16-omap1~131 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=2043db27e0a59c6eb959e2722149378685098818;p=linux-2.6-omap-h63xx.git Fix for [patch 6/6] serial8250: convert to the new platform device interface This patch fixes serial port problems on omap. --- diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 4425691fa43..d587f4355e3 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c @@ -2612,15 +2612,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); @@ -2629,12 +2625,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: