aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/scx200_wdt.c
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2007-12-26 15:32:51 -0500
committerWim Van Sebroeck <wim@iguana.be>2008-01-25 15:31:50 -0500
commitc6cb13aead3a3cf5bd3e2cfa945602d5cd7825cd (patch)
treeecff4a444e33d0ca24925e92fee4f9021ba981b8 /drivers/watchdog/scx200_wdt.c
parent01c785dcb4e9fd6c4c370fd9915fc10585ed64bd (diff)
[WATCHDOG] misc_register patch
Make sure that we first do a register_reboot_notifier before we do a misc_register. A misc_register opens the interface to userspace and it's best to do this as the last action. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog/scx200_wdt.c')
-rw-r--r--drivers/watchdog/scx200_wdt.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c
index d4fd0fa2f176..d55882bca319 100644
--- a/drivers/watchdog/scx200_wdt.c
+++ b/drivers/watchdog/scx200_wdt.c
@@ -231,17 +231,17 @@ static int __init scx200_wdt_init(void)
231 231
232 sema_init(&open_semaphore, 1); 232 sema_init(&open_semaphore, 1);
233 233
234 r = misc_register(&scx200_wdt_miscdev); 234 r = register_reboot_notifier(&scx200_wdt_notifier);
235 if (r) { 235 if (r) {
236 printk(KERN_ERR NAME ": unable to register reboot notifier");
236 release_region(scx200_cb_base + SCx200_WDT_OFFSET, 237 release_region(scx200_cb_base + SCx200_WDT_OFFSET,
237 SCx200_WDT_SIZE); 238 SCx200_WDT_SIZE);
238 return r; 239 return r;
239 } 240 }
240 241
241 r = register_reboot_notifier(&scx200_wdt_notifier); 242 r = misc_register(&scx200_wdt_miscdev);
242 if (r) { 243 if (r) {
243 printk(KERN_ERR NAME ": unable to register reboot notifier"); 244 unregister_reboot_notifier(&scx200_wdt_notifier);
244 misc_deregister(&scx200_wdt_miscdev);
245 release_region(scx200_cb_base + SCx200_WDT_OFFSET, 245 release_region(scx200_cb_base + SCx200_WDT_OFFSET,
246 SCx200_WDT_SIZE); 246 SCx200_WDT_SIZE);
247 return r; 247 return r;
@@ -252,8 +252,8 @@ static int __init scx200_wdt_init(void)
252 252
253static void __exit scx200_wdt_cleanup(void) 253static void __exit scx200_wdt_cleanup(void)
254{ 254{
255 unregister_reboot_notifier(&scx200_wdt_notifier);
256 misc_deregister(&scx200_wdt_miscdev); 255 misc_deregister(&scx200_wdt_miscdev);
256 unregister_reboot_notifier(&scx200_wdt_notifier);
257 release_region(scx200_cb_base + SCx200_WDT_OFFSET, 257 release_region(scx200_cb_base + SCx200_WDT_OFFSET,
258 SCx200_WDT_SIZE); 258 SCx200_WDT_SIZE);
259} 259}