]> err.no Git - linux-2.6/commitdiff
[PATCH] mv64x600_wdt: convert to the new platform device interface
authorDmitry Torokhov <dtor_core@ameritech.net>
Wed, 22 Mar 2006 08:07:54 +0000 (00:07 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Wed, 22 Mar 2006 15:53:56 +0000 (07:53 -0800)
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/char/watchdog/mv64x60_wdt.c

index 00d9ef04a3697dde00f1d2121c526c33f4ec0c5e..f1b9cf89f153ab727d357435437c0f6fc54dea73 100644 (file)
@@ -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;
 }