aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/mv64x60_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/watchdog/mv64x60_wdt.c')
-rw-r--r--drivers/char/watchdog/mv64x60_wdt.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/char/watchdog/mv64x60_wdt.c b/drivers/char/watchdog/mv64x60_wdt.c
index 00d9ef04a369..f1b9cf89f153 100644
--- a/drivers/char/watchdog/mv64x60_wdt.c
+++ b/drivers/char/watchdog/mv64x60_wdt.c
@@ -228,15 +228,25 @@ static int __init mv64x60_wdt_init(void)
228 228
229 printk(KERN_INFO "MV64x60 watchdog driver\n"); 229 printk(KERN_INFO "MV64x60 watchdog driver\n");
230 230
231 mv64x60_wdt_dev = platform_device_register_simple(MV64x60_WDT_NAME, 231 mv64x60_wdt_dev = platform_device_alloc(MV64x60_WDT_NAME, -1);
232 -1, NULL, 0); 232 if (!mv64x60_wdt_dev) {
233 if (IS_ERR(mv64x60_wdt_dev)) { 233 ret = -ENOMEM;
234 ret = PTR_ERR(mv64x60_wdt_dev); 234 goto out;
235 }
236
237 ret = platform_device_add(mv64x60_wdt_dev);
238 if (ret) {
239 platform_device_put(mv64x60_wdt_dev);
235 goto out; 240 goto out;
236 } 241 }
237 242
238 ret = platform_driver_register(&mv64x60_wdt_driver); 243 ret = platform_driver_register(&mv64x60_wdt_driver);
239 out: 244 if (ret) {
245 platform_device_unregister(mv64x60_wdt_dev);
246 goto out;
247 }
248
249 out:
240 return ret; 250 return ret;
241} 251}
242 252