aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/at32ap700x_wdt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/watchdog/at32ap700x_wdt.c')
-rw-r--r--drivers/watchdog/at32ap700x_wdt.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/watchdog/at32ap700x_wdt.c b/drivers/watchdog/at32ap700x_wdt.c
index 1cddf92cb9a6..750bc5281d79 100644
--- a/drivers/watchdog/at32ap700x_wdt.c
+++ b/drivers/watchdog/at32ap700x_wdt.c
@@ -346,9 +346,13 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
346 } else { 346 } else {
347 wdt->users = 0; 347 wdt->users = 0;
348 } 348 }
349 wdt->miscdev.minor = WATCHDOG_MINOR; 349
350 wdt->miscdev.name = "watchdog"; 350 wdt->miscdev.minor = WATCHDOG_MINOR;
351 wdt->miscdev.fops = &at32_wdt_fops; 351 wdt->miscdev.name = "watchdog";
352 wdt->miscdev.fops = &at32_wdt_fops;
353 wdt->miscdev.parent = &pdev->dev;
354
355 platform_set_drvdata(pdev, wdt);
352 356
353 if (at32_wdt_settimeout(timeout)) { 357 if (at32_wdt_settimeout(timeout)) {
354 at32_wdt_settimeout(TIMEOUT_DEFAULT); 358 at32_wdt_settimeout(TIMEOUT_DEFAULT);
@@ -360,17 +364,17 @@ static int __init at32_wdt_probe(struct platform_device *pdev)
360 ret = misc_register(&wdt->miscdev); 364 ret = misc_register(&wdt->miscdev);
361 if (ret) { 365 if (ret) {
362 dev_dbg(&pdev->dev, "failed to register wdt miscdev\n"); 366 dev_dbg(&pdev->dev, "failed to register wdt miscdev\n");
363 goto err_iounmap; 367 goto err_register;
364 } 368 }
365 369
366 platform_set_drvdata(pdev, wdt);
367 wdt->miscdev.parent = &pdev->dev;
368 dev_info(&pdev->dev, 370 dev_info(&pdev->dev,
369 "AT32AP700X WDT at 0x%p, timeout %d sec (nowayout=%d)\n", 371 "AT32AP700X WDT at 0x%p, timeout %d sec (nowayout=%d)\n",
370 wdt->regs, wdt->timeout, nowayout); 372 wdt->regs, wdt->timeout, nowayout);
371 373
372 return 0; 374 return 0;
373 375
376err_register:
377 platform_set_drvdata(pdev, NULL);
374err_iounmap: 378err_iounmap:
375 iounmap(wdt->regs); 379 iounmap(wdt->regs);
376err_free: 380err_free: