Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19628
b: refs/heads/master
c: de6c642
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Feb 3, 2006
1 parent f673d2c commit b148e07
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 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: 5423980245c56fd968840b6d36bbddc2719084e4
refs/heads/master: de6c642ca9566ed358e1cde5fa0e25f7788a5566
13 changes: 11 additions & 2 deletions trunk/drivers/char/watchdog/sbc_epx_c3.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/notifier.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/ioport.h>
#include <asm/uaccess.h>
#include <asm/io.h>

Expand Down Expand Up @@ -181,30 +182,38 @@ static int __init watchdog_init(void)
{
int ret;

if (!request_region(EPXC3_WATCHDOG_CTL_REG, 2, "epxc3_watchdog"))
return -EBUSY;

ret = register_reboot_notifier(&epx_c3_notifier);
if (ret) {
printk(KERN_ERR PFX "cannot register reboot notifier "
"(err=%d)\n", ret);
return ret;
goto out;
}

ret = misc_register(&epx_c3_miscdev);
if (ret) {
printk(KERN_ERR PFX "cannot register miscdev on minor=%d "
"(err=%d)\n", WATCHDOG_MINOR, ret);
unregister_reboot_notifier(&epx_c3_notifier);
return ret;
goto out;
}

printk(banner);

return 0;

out:
release_region(EPXC3_WATCHDOG_CTL_REG, 2);
return ret;
}

static void __exit watchdog_exit(void)
{
misc_deregister(&epx_c3_miscdev);
unregister_reboot_notifier(&epx_c3_notifier);
release_region(EPXC3_WATCHDOG_CTL_REG, 2);
}

module_init(watchdog_init);
Expand Down

0 comments on commit b148e07

Please sign in to comment.