[PATCH] 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> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
d39b6cfe66
commit
eee8ab75c6
1 changed files with 15 additions and 5 deletions
|
@ -228,14 +228,24 @@ static int __init mv64x60_wdt_init(void)
|
||||||
|
|
||||||
printk(KERN_INFO "MV64x60 watchdog driver\n");
|
printk(KERN_INFO "MV64x60 watchdog driver\n");
|
||||||
|
|
||||||
mv64x60_wdt_dev = platform_device_register_simple(MV64x60_WDT_NAME,
|
mv64x60_wdt_dev = platform_device_alloc(MV64x60_WDT_NAME, -1);
|
||||||
-1, NULL, 0);
|
if (!mv64x60_wdt_dev) {
|
||||||
if (IS_ERR(mv64x60_wdt_dev)) {
|
ret = -ENOMEM;
|
||||||
ret = PTR_ERR(mv64x60_wdt_dev);
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = platform_device_add(mv64x60_wdt_dev);
|
||||||
|
if (ret) {
|
||||||
|
platform_device_put(mv64x60_wdt_dev);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = platform_driver_register(&mv64x60_wdt_driver);
|
ret = platform_driver_register(&mv64x60_wdt_driver);
|
||||||
|
if (ret) {
|
||||||
|
platform_device_unregister(mv64x60_wdt_dev);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue