diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-10 23:33:03 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-10 23:33:03 +0200 |
commit | a9deecba19b8f384d97f82c75379da48bccb2588 (patch) | |
tree | ed909c58167b93304e74e67d1e8fcbcc37f4de92 /drivers/char/watchdog/sbc8360.c | |
parent | Allow compat_ioctl.c to compile without CONFIG_NET (diff) | |
parent | [WATCHDOG] MTX-1 Watchdog driver (diff) | |
download | linux-a9deecba19b8f384d97f82c75379da48bccb2588.tar.xz linux-a9deecba19b8f384d97f82c75379da48bccb2588.zip |
Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
* master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
[WATCHDOG] MTX-1 Watchdog driver
[WATCHDOG] s3c2410_wdt - initialize watchdog irq resource
[WATCHDOG] Kconfig menuconfig patch
[WATCHDOG] pcwd.c: Port to the new device driver model
[WATCHDOG] use mutex instead of semaphore in Berkshire USB-PC Watchdog driver
[WATCHDOG] the scheduled removal of the i8xx_tco watchdog driver
[WATCHDOG] Semi-typical watchdog bug re early misc_register()
[WATCHDOG] add support for the w83627thf chipset.
Diffstat (limited to 'drivers/char/watchdog/sbc8360.c')
-rw-r--r-- | drivers/char/watchdog/sbc8360.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/char/watchdog/sbc8360.c b/drivers/char/watchdog/sbc8360.c index 67ae42685e75..285d85289532 100644 --- a/drivers/char/watchdog/sbc8360.c +++ b/drivers/char/watchdog/sbc8360.c @@ -333,18 +333,17 @@ static int __init sbc8360_init(void) int res; unsigned long int mseconds = 60000; - spin_lock_init(&sbc8360_lock); - res = misc_register(&sbc8360_miscdev); - if (res) { - printk(KERN_ERR PFX "failed to register misc device\n"); - goto out_nomisc; + if (timeout < 0 || timeout > 63) { + printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n"); + res = -EINVAL; + goto out; } if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) { printk(KERN_ERR PFX "ENABLE method I/O %X is not available.\n", SBC8360_ENABLE); res = -EIO; - goto out_noenablereg; + goto out; } if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) { printk(KERN_ERR PFX @@ -360,10 +359,11 @@ static int __init sbc8360_init(void) goto out_noreboot; } - if (timeout < 0 || timeout > 63) { - printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n"); - res = -EINVAL; - goto out_noreboot; + spin_lock_init(&sbc8360_lock); + res = misc_register(&sbc8360_miscdev); + if (res) { + printk(KERN_ERR PFX "failed to register misc device\n"); + goto out_nomisc; } wd_margin = wd_times[timeout][0]; @@ -383,13 +383,13 @@ static int __init sbc8360_init(void) return 0; + out_nomisc: + unregister_reboot_notifier(&sbc8360_notifier); out_noreboot: - release_region(SBC8360_ENABLE, 1); release_region(SBC8360_BASETIME, 1); - out_noenablereg: out_nobasetimereg: - misc_deregister(&sbc8360_miscdev); - out_nomisc: + release_region(SBC8360_ENABLE, 1); + out: return res; } |