Commit 7493a314 authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Russell King

[SERIAL] serial8250: convert to the new platform device interface

Do not use platform_device_register_simple() as it is going away.
Also set up driver's owner to create link driver->module in sysfs.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent d600b97c
...@@ -2454,6 +2454,7 @@ static struct platform_driver serial8250_isa_driver = { ...@@ -2454,6 +2454,7 @@ static struct platform_driver serial8250_isa_driver = {
.resume = serial8250_resume, .resume = serial8250_resume,
.driver = { .driver = {
.name = "serial8250", .name = "serial8250",
.owner = THIS_MODULE,
}, },
}; };
...@@ -2594,21 +2595,30 @@ static int __init serial8250_init(void) ...@@ -2594,21 +2595,30 @@ static int __init serial8250_init(void)
if (ret) if (ret)
goto out; goto out;
serial8250_isa_devs = platform_device_register_simple("serial8250", ret = platform_driver_register(&serial8250_isa_driver);
PLAT8250_DEV_LEGACY, NULL, 0); if (ret)
if (IS_ERR(serial8250_isa_devs)) { goto unreg_uart_drv;
ret = PTR_ERR(serial8250_isa_devs);
goto unreg; serial8250_isa_devs = platform_device_alloc("serial8250",
PLAT8250_DEV_LEGACY);
if (!serial8250_isa_devs) {
ret = -ENOMEM;
goto unreg_plat_drv;
} }
ret = platform_device_add(serial8250_isa_devs);
if (ret)
goto put_dev;
serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev); serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev);
ret = platform_driver_register(&serial8250_isa_driver); goto out;
if (ret == 0)
goto out;
platform_device_unregister(serial8250_isa_devs); put_dev:
unreg: platform_device_put(serial8250_isa_devs);
unreg_plat_drv:
platform_driver_unregister(&serial8250_isa_driver);
unreg_uart_drv:
uart_unregister_driver(&serial8250_reg); uart_unregister_driver(&serial8250_reg);
out: out:
return ret; return ret;
......
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