lkml.org 
[lkml]   [2006]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 3/6] mv64x600_wdt: convert to the new platform device interface

mv64x600_wdt: convert to the new platform device interface
Do not use platform_device_register_simple() as it is going away.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---

drivers/char/watchdog/mv64x60_wdt.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)

Index: work/drivers/char/watchdog/mv64x60_wdt.c
===================================================================
--- work.orig/drivers/char/watchdog/mv64x60_wdt.c
+++ work/drivers/char/watchdog/mv64x60_wdt.c
@@ -228,15 +228,25 @@ static int __init mv64x60_wdt_init(void)

printk(KERN_INFO "MV64x60 watchdog driver\n");

- mv64x60_wdt_dev = platform_device_register_simple(MV64x60_WDT_NAME,
- -1, NULL, 0);
- if (IS_ERR(mv64x60_wdt_dev)) {
- ret = PTR_ERR(mv64x60_wdt_dev);
+ mv64x60_wdt_dev = platform_device_alloc(MV64x60_WDT_NAME, -1);
+ if (!mv64x60_wdt_dev) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ ret = platform_device_add(mv64x60_wdt_dev);
+ if (ret) {
+ platform_device_put(mv64x60_wdt_dev);
goto out;
}

ret = platform_driver_register(&mv64x60_wdt_driver);
- out:
+ if (ret) {
+ platform_device_unregister(mv64x60_wdt_dev);
+ goto out;
+ }
+
+ out:
return ret;
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-11 08:02    [W:3.090 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site