diff options
author | Damien Riegel <damien.riegel@savoirfairelinux.com> | 2015-11-20 16:54:56 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2015-12-13 09:56:09 -0500 |
commit | d68106bbec2c2a33faacd50a1f7d24954701f505 (patch) | |
tree | 6cbcba8bdf5a1c49c30cdb843f41b162f03e2787 /drivers/watchdog/w83627hf_wdt.c | |
parent | 84ebcc17f281ed6ce1e6a7b4b0d9f15da727edd5 (diff) |
watchdog: w83627hf_wdt: use core reboot notifier
Get rid of the custom reboot notifier block registration and use the one
provided by the watchdog core.
Signed-off-by: Damien Riegel <damien.riegel@savoirfairelinux.com>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirlinux.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/w83627hf_wdt.c')
-rw-r--r-- | drivers/watchdog/w83627hf_wdt.c | 32 |
1 files changed, 2 insertions, 30 deletions
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index 5824e25eebbb..cab14bc9106c 100644 --- a/drivers/watchdog/w83627hf_wdt.c +++ b/drivers/watchdog/w83627hf_wdt.c | |||
@@ -36,8 +36,6 @@ | |||
36 | #include <linux/types.h> | 36 | #include <linux/types.h> |
37 | #include <linux/watchdog.h> | 37 | #include <linux/watchdog.h> |
38 | #include <linux/ioport.h> | 38 | #include <linux/ioport.h> |
39 | #include <linux/notifier.h> | ||
40 | #include <linux/reboot.h> | ||
41 | #include <linux/init.h> | 39 | #include <linux/init.h> |
42 | #include <linux/io.h> | 40 | #include <linux/io.h> |
43 | 41 | ||
@@ -288,18 +286,6 @@ static unsigned int wdt_get_time(struct watchdog_device *wdog) | |||
288 | } | 286 | } |
289 | 287 | ||
290 | /* | 288 | /* |
291 | * Notifier for system down | ||
292 | */ | ||
293 | static int wdt_notify_sys(struct notifier_block *this, unsigned long code, | ||
294 | void *unused) | ||
295 | { | ||
296 | if (code == SYS_DOWN || code == SYS_HALT) | ||
297 | wdt_set_time(0); /* Turn the WDT off */ | ||
298 | |||
299 | return NOTIFY_DONE; | ||
300 | } | ||
301 | |||
302 | /* | ||
303 | * Kernel Interfaces | 289 | * Kernel Interfaces |
304 | */ | 290 | */ |
305 | 291 | ||
@@ -329,10 +315,6 @@ static struct watchdog_device wdt_dev = { | |||
329 | * turn the timebomb registers off. | 315 | * turn the timebomb registers off. |
330 | */ | 316 | */ |
331 | 317 | ||
332 | static struct notifier_block wdt_notifier = { | ||
333 | .notifier_call = wdt_notify_sys, | ||
334 | }; | ||
335 | |||
336 | static int wdt_find(int addr) | 318 | static int wdt_find(int addr) |
337 | { | 319 | { |
338 | u8 val; | 320 | u8 val; |
@@ -456,6 +438,7 @@ static int __init wdt_init(void) | |||
456 | 438 | ||
457 | watchdog_init_timeout(&wdt_dev, timeout, NULL); | 439 | watchdog_init_timeout(&wdt_dev, timeout, NULL); |
458 | watchdog_set_nowayout(&wdt_dev, nowayout); | 440 | watchdog_set_nowayout(&wdt_dev, nowayout); |
441 | watchdog_stop_on_reboot(&wdt_dev); | ||
459 | 442 | ||
460 | ret = w83627hf_init(&wdt_dev, chip); | 443 | ret = w83627hf_init(&wdt_dev, chip); |
461 | if (ret) { | 444 | if (ret) { |
@@ -463,30 +446,19 @@ static int __init wdt_init(void) | |||
463 | return ret; | 446 | return ret; |
464 | } | 447 | } |
465 | 448 | ||
466 | ret = register_reboot_notifier(&wdt_notifier); | ||
467 | if (ret != 0) { | ||
468 | pr_err("cannot register reboot notifier (err=%d)\n", ret); | ||
469 | return ret; | ||
470 | } | ||
471 | |||
472 | ret = watchdog_register_device(&wdt_dev); | 449 | ret = watchdog_register_device(&wdt_dev); |
473 | if (ret) | 450 | if (ret) |
474 | goto unreg_reboot; | 451 | return ret; |
475 | 452 | ||
476 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", | 453 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
477 | wdt_dev.timeout, nowayout); | 454 | wdt_dev.timeout, nowayout); |
478 | 455 | ||
479 | return ret; | 456 | return ret; |
480 | |||
481 | unreg_reboot: | ||
482 | unregister_reboot_notifier(&wdt_notifier); | ||
483 | return ret; | ||
484 | } | 457 | } |
485 | 458 | ||
486 | static void __exit wdt_exit(void) | 459 | static void __exit wdt_exit(void) |
487 | { | 460 | { |
488 | watchdog_unregister_device(&wdt_dev); | 461 | watchdog_unregister_device(&wdt_dev); |
489 | unregister_reboot_notifier(&wdt_notifier); | ||
490 | } | 462 | } |
491 | 463 | ||
492 | module_init(wdt_init); | 464 | module_init(wdt_init); |