aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-02-03 06:03:58 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-02-03 11:32:02 -0500
commitde6c642ca9566ed358e1cde5fa0e25f7788a5566 (patch)
treeefba9a9cc23f0f7351a7ea01c29bcdd400698744 /drivers/char
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')
-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 951764614ebf..7a4dfb95d087 100644
--- a/drivers/char/watchdog/sbc_epx_c3.c
+++ b/drivers/char/watchdog/sbc_epx_c3.c
@@ -25,6 +25,7 @@
25#include <linux/notifier.h> 25#include <linux/notifier.h>
26#include <linux/reboot.h> 26#include <linux/reboot.h>
27#include <linux/init.h> 27#include <linux/init.h>
28#include <linux/ioport.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/io.h> 30#include <asm/io.h>
30 31
@@ -181,11 +182,14 @@ static int __init watchdog_init(void)
181{ 182{
182 int ret; 183 int ret;
183 184
185 if (!request_region(EPXC3_WATCHDOG_CTL_REG, 2, "epxc3_watchdog"))
186 return -EBUSY;
187
184 ret = register_reboot_notifier(&epx_c3_notifier); 188 ret = register_reboot_notifier(&epx_c3_notifier);
185 if (ret) { 189 if (ret) {
186 printk(KERN_ERR PFX "cannot register reboot notifier " 190 printk(KERN_ERR PFX "cannot register reboot notifier "
187 "(err=%d)\n", ret); 191 "(err=%d)\n", ret);
188 return ret; 192 goto out;
189 } 193 }
190 194
191 ret = misc_register(&epx_c3_miscdev); 195 ret = misc_register(&epx_c3_miscdev);
@@ -193,18 +197,23 @@ static int __init watchdog_init(void)
193 printk(KERN_ERR PFX "cannot register miscdev on minor=%d " 197 printk(KERN_ERR PFX "cannot register miscdev on minor=%d "
194 "(err=%d)\n", WATCHDOG_MINOR, ret); 198 "(err=%d)\n", WATCHDOG_MINOR, ret);
195 unregister_reboot_notifier(&epx_c3_notifier); 199 unregister_reboot_notifier(&epx_c3_notifier);
196 return ret; 200 goto out;
197 } 201 }
198 202
199 printk(banner); 203 printk(banner);
200 204
201 return 0; 205 return 0;
206
207out:
208 release_region(EPXC3_WATCHDOG_CTL_REG, 2);
209 return ret;
202} 210}
203 211
204static void __exit watchdog_exit(void) 212static void __exit watchdog_exit(void)
205{ 213{
206 misc_deregister(&epx_c3_miscdev); 214 misc_deregister(&epx_c3_miscdev);
207 unregister_reboot_notifier(&epx_c3_notifier); 215 unregister_reboot_notifier(&epx_c3_notifier);
216 release_region(EPXC3_WATCHDOG_CTL_REG, 2);
208} 217}
209 218
210module_init(watchdog_init); 219module_init(watchdog_init);