summaryrefslogtreecommitdiffstats
path: root/drivers/char/watchdog/sbc_epx_c3.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-02-03 03:03:58 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 08:32:02 -0800
commitde6c642ca9566ed358e1cde5fa0e25f7788a5566 (patch)
treeefba9a9cc23f0f7351a7ea01c29bcdd400698744 /drivers/char/watchdog/sbc_epx_c3.c
parent5423980245c56fd968840b6d36bbddc2719084e4 (diff)
[PATCH] SBC EPX does not check/claim I/O ports it uses (2nd Edition)
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/watchdog/sbc_epx_c3.c')
-rw-r--r--drivers/char/watchdog/sbc_epx_c3.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/char/watchdog/sbc_epx_c3.c b/drivers/char/watchdog/sbc_epx_c3.c
index 951764614eb..7a4dfb95d08 100644
--- a/drivers/char/watchdog/sbc_epx_c3.c
+++ b/drivers/char/watchdog/sbc_epx_c3.c
@@ -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>
@@ -181,11 +182,14 @@ 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);
@@ -193,18 +197,23 @@ static int __init watchdog_init(void)
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);