summaryrefslogtreecommitdiffstats
path: root/drivers/serial/vr41xx_siu.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor_core@ameritech.net>2006-03-22 00:07:53 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-22 07:53:56 -0800
commitd39b6cfe664079ca79ae1cfebac4725a877fd61d (patch)
tree85a4a2784819406ac86d4f30d9764cb363c2c83b /drivers/serial/vr41xx_siu.c
parentf4a641d66c6e135dcfc861521e8008faed2411e1 (diff)
downloadblackbird-obmc-linux-d39b6cfe664079ca79ae1cfebac4725a877fd61d.tar.gz
blackbird-obmc-linux-d39b6cfe664079ca79ae1cfebac4725a877fd61d.zip
[PATCH] vr41xx: convert to the new platform device interface
The patch does the following for v441xx seris drivers: - stop using platform_device_register_simple() as it is going away - mark ->probe() and ->remove() methods as __devinit and __devexit respectively - initialize "owner" field in driver structure so there is a link from /sys/modules to the driver - mark *_init() and *_exit() functions as __init and __exit Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/serial/vr41xx_siu.c')
-rw-r--r--drivers/serial/vr41xx_siu.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/serial/vr41xx_siu.c b/drivers/serial/vr41xx_siu.c
index d61494d185cd..bd6294132c18 100644
--- a/drivers/serial/vr41xx_siu.c
+++ b/drivers/serial/vr41xx_siu.c
@@ -919,7 +919,7 @@ static struct uart_driver siu_uart_driver = {
.cons = SERIAL_VR41XX_CONSOLE,
};
-static int siu_probe(struct platform_device *dev)
+static int __devinit siu_probe(struct platform_device *dev)
{
struct uart_port *port;
int num, i, retval;
@@ -953,7 +953,7 @@ static int siu_probe(struct platform_device *dev)
return 0;
}
-static int siu_remove(struct platform_device *dev)
+static int __devexit siu_remove(struct platform_device *dev)
{
struct uart_port *port;
int i;
@@ -1006,21 +1006,28 @@ static struct platform_device *siu_platform_device;
static struct platform_driver siu_device_driver = {
.probe = siu_probe,
- .remove = siu_remove,
+ .remove = __devexit_p(siu_remove),
.suspend = siu_suspend,
.resume = siu_resume,
.driver = {
.name = "SIU",
+ .owner = THIS_MODULE,
},
};
-static int __devinit vr41xx_siu_init(void)
+static int __init vr41xx_siu_init(void)
{
int retval;
- siu_platform_device = platform_device_register_simple("SIU", -1, NULL, 0);
- if (IS_ERR(siu_platform_device))
- return PTR_ERR(siu_platform_device);
+ siu_platform_device = platform_device_alloc("SIU", -1);
+ if (!siu_platform_device)
+ return -ENOMEM;
+
+ retval = platform_device_add(siu_platform_device);
+ if (retval < 0) {
+ platform_device_put(siu_platform_device);
+ return retval;
+ }
retval = platform_driver_register(&siu_device_driver);
if (retval < 0)
@@ -1029,10 +1036,9 @@ static int __devinit vr41xx_siu_init(void)
return retval;
}
-static void __devexit vr41xx_siu_exit(void)
+static void __exit vr41xx_siu_exit(void)
{
platform_driver_unregister(&siu_device_driver);
-
platform_device_unregister(siu_platform_device);
}
OpenPOWER on IntegriCloud