Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48147
b: refs/heads/master
c: f6e4803
h: refs/heads/master
i:
  48145: 2fff7b8
  48143: ddc3a19
v: v3
  • Loading branch information
Wim Van Sebroeck committed Jan 27, 2007
1 parent b412148 commit b6f5765
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35d55c943117864b9dff0253eb64672f048ac0f8
refs/heads/master: f6e4803969ee93bef6aeeb6aff0f9214547d1bb1
22 changes: 14 additions & 8 deletions trunk/drivers/char/watchdog/ib700wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,18 +300,17 @@ static struct notifier_block ibwdt_notifier = {
.notifier_call = ibwdt_notify_sys,
};

/*
* Init & exit routines
*/

static int __init ibwdt_init(void)
{
int res;

printk(KERN_INFO PFX "WDT driver for IB700 single board computer initialising.\n");

spin_lock_init(&ibwdt_lock);
res = misc_register(&ibwdt_miscdev);
if (res) {
printk (KERN_ERR PFX "failed to register misc device\n");
goto out_nomisc;
}

#if WDT_START != WDT_STOP
if (!request_region(WDT_STOP, 1, "IB700 WDT")) {
Expand All @@ -326,22 +325,29 @@ static int __init ibwdt_init(void)
res = -EIO;
goto out_nostartreg;
}

res = register_reboot_notifier(&ibwdt_notifier);
if (res) {
printk (KERN_ERR PFX "Failed to register reboot notifier.\n");
goto out_noreboot;
}

res = misc_register(&ibwdt_miscdev);
if (res) {
printk (KERN_ERR PFX "failed to register misc device\n");
goto out_nomisc;
}
return 0;

out_nomisc:
unregister_reboot_notifier(&ibwdt_notifier);
out_noreboot:
release_region(WDT_START, 1);
out_nostartreg:
#if WDT_START != WDT_STOP
release_region(WDT_STOP, 1);
#endif
out_nostopreg:
misc_deregister(&ibwdt_miscdev);
out_nomisc:
return res;
}

Expand All @@ -350,10 +356,10 @@ ibwdt_exit(void)
{
misc_deregister(&ibwdt_miscdev);
unregister_reboot_notifier(&ibwdt_notifier);
release_region(WDT_START,1);
#if WDT_START != WDT_STOP
release_region(WDT_STOP,1);
#endif
release_region(WDT_START,1);
}

module_init(ibwdt_init);
Expand Down

0 comments on commit b6f5765

Please sign in to comment.