From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Andrew Morton <akpm@osdl.org>
Cc: LKML <linux-kernel@vger.kernel.org>, Russell King <rmk@arm.linux.org.uk>
Subject: [patch 6/6] serial8250: convert to the new platform device interface
Date: Wed, 11 Jan 2006 01:47:52 -0500 [thread overview]
Message-ID: <20060111065752.245711000.dtor_core@ameritech.net> (raw)
In-Reply-To: <20060111064746.560312000.dtor_core@ameritech.net>
[-- Attachment #1: 8250-new-platform-intf.patch --]
[-- Type: text/plain, Size: 1779 bytes --]
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: Dmitry Torokhov <dtor@mail.ru>
---
drivers/serial/8250.c | 30 ++++++++++++++++++++----------
1 files changed, 20 insertions(+), 10 deletions(-)
Index: work/drivers/serial/8250.c
===================================================================
--- work.orig/drivers/serial/8250.c
+++ work/drivers/serial/8250.c
@@ -2453,6 +2453,7 @@ static struct platform_driver serial8250
.resume = serial8250_resume,
.driver = {
.name = "serial8250",
+ .owner = THIS_MODULE,
},
};
@@ -2593,21 +2594,30 @@ static int __init serial8250_init(void)
if (ret)
goto out;
- serial8250_isa_devs = platform_device_register_simple("serial8250",
- PLAT8250_DEV_LEGACY, NULL, 0);
- if (IS_ERR(serial8250_isa_devs)) {
- ret = PTR_ERR(serial8250_isa_devs);
- goto unreg;
+ 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;
}
+ ret = platform_device_add(serial8250_isa_devs);
+ if (ret)
+ goto put_dev;
+
serial8250_register_ports(&serial8250_reg, &serial8250_isa_devs->dev);
- ret = platform_driver_register(&serial8250_isa_driver);
- if (ret == 0)
- goto out;
+ goto out;
- platform_device_unregister(serial8250_isa_devs);
- unreg:
+ 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:
return ret;
next prev parent reply other threads:[~2006-01-11 6:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-11 6:47 [patch 0/6] Assorted conversions " Dmitry Torokhov
2006-01-11 6:47 ` [patch 1/6] hdaps: convert " Dmitry Torokhov
2006-01-11 6:47 ` [patch 2/6] vr41xx: " Dmitry Torokhov
2006-01-11 6:47 ` [patch 3/6] mv64x600_wdt: " Dmitry Torokhov
2006-01-11 6:47 ` [patch 4/6] tb0219: " Dmitry Torokhov
2006-01-11 6:47 ` [patch 5/6] dcdbas: " Dmitry Torokhov
2006-01-11 6:47 ` Dmitry Torokhov [this message]
2006-01-16 22:27 ` [patch 6/6] serial8250: " Kumar Gala
2006-01-16 23:31 ` Russell King
2006-01-16 23:54 ` Kumar Gala
2006-01-17 2:35 ` Tony Lindgren
2006-01-17 19:36 ` Olaf Hering
2006-01-18 9:56 ` Russell King
2006-01-18 10:10 ` Olaf Hering
2006-01-18 11:03 ` Olaf Hering
2006-01-17 21:41 ` Grant Likely
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060111065752.245711000.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome