mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 16:29:59 +00:00
[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>
This commit is contained in:
parent
5423980245
commit
de6c642ca9
1 changed files with 11 additions and 2 deletions
|
@ -25,6 +25,7 @@
|
||||||
#include <linux/notifier.h>
|
#include <linux/notifier.h>
|
||||||
#include <linux/reboot.h>
|
#include <linux/reboot.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
#include <linux/ioport.h>
|
||||||
#include <asm/uaccess.h>
|
#include <asm/uaccess.h>
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
|
@ -181,11 +182,14 @@ static int __init watchdog_init(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
if (!request_region(EPXC3_WATCHDOG_CTL_REG, 2, "epxc3_watchdog"))
|
||||||
|
return -EBUSY;
|
||||||
|
|
||||||
ret = register_reboot_notifier(&epx_c3_notifier);
|
ret = register_reboot_notifier(&epx_c3_notifier);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
printk(KERN_ERR PFX "cannot register reboot notifier "
|
printk(KERN_ERR PFX "cannot register reboot notifier "
|
||||||
"(err=%d)\n", ret);
|
"(err=%d)\n", ret);
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = misc_register(&epx_c3_miscdev);
|
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 "
|
printk(KERN_ERR PFX "cannot register miscdev on minor=%d "
|
||||||
"(err=%d)\n", WATCHDOG_MINOR, ret);
|
"(err=%d)\n", WATCHDOG_MINOR, ret);
|
||||||
unregister_reboot_notifier(&epx_c3_notifier);
|
unregister_reboot_notifier(&epx_c3_notifier);
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
printk(banner);
|
printk(banner);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
out:
|
||||||
|
release_region(EPXC3_WATCHDOG_CTL_REG, 2);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __exit watchdog_exit(void)
|
static void __exit watchdog_exit(void)
|
||||||
{
|
{
|
||||||
misc_deregister(&epx_c3_miscdev);
|
misc_deregister(&epx_c3_miscdev);
|
||||||
unregister_reboot_notifier(&epx_c3_notifier);
|
unregister_reboot_notifier(&epx_c3_notifier);
|
||||||
|
release_region(EPXC3_WATCHDOG_CTL_REG, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(watchdog_init);
|
module_init(watchdog_init);
|
||||||
|
|
Loading…
Reference in a new issue