Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48151
b: refs/heads/master
c: 35fcf53
h: refs/heads/master
i:
  48149: 54b99a9
  48147: b6f5765
  48143: ddc3a19
v: v3
  • Loading branch information
Wim Van Sebroeck committed Jan 27, 2007
1 parent 38e080c commit abb3cf0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 36 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: 745ac1ea6e06125cc1326adbec34d756b25678c6
refs/heads/master: 35fcf53870eaa6cc966604a6e36df1c2c1577540
42 changes: 7 additions & 35 deletions trunk/drivers/char/watchdog/ib700wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
#include <linux/miscdevice.h>
#include <linux/watchdog.h>
#include <linux/ioport.h>
#include <linux/notifier.h>
#include <linux/fs.h>
#include <linux/reboot.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#include <linux/moduleparam.h>
Expand Down Expand Up @@ -283,21 +281,6 @@ ibwdt_close(struct inode *inode, struct file *file)
return 0;
}

/*
* Notifier for system down
*/

static int
ibwdt_notify_sys(struct notifier_block *this, unsigned long code,
void *unused)
{
if (code == SYS_DOWN || code == SYS_HALT) {
/* Turn the WDT off */
ibwdt_disable();
}
return NOTIFY_DONE;
}

/*
* Kernel Interfaces
*/
Expand All @@ -317,15 +300,6 @@ static struct miscdevice ibwdt_miscdev = {
.fops = &ibwdt_fops,
};

/*
* The WDT needs to learn about soft shutdowns in order to
* turn the timebomb registers off.
*/

static struct notifier_block ibwdt_notifier = {
.notifier_call = ibwdt_notify_sys,
};

/*
* Init & exit routines
*/
Expand All @@ -350,12 +324,6 @@ static int __devinit ibwdt_probe(struct platform_device *dev)
goto out_nostartreg;
}

res = register_reboot_notifier(&ibwdt_notifier);
if (res) {
printk (KERN_ERR PFX "Failed to register reboot notifier.\n");
goto out_noreboot;
}

res = misc_register(&ibwdt_miscdev);
if (res) {
printk (KERN_ERR PFX "failed to register misc device\n");
Expand All @@ -364,8 +332,6 @@ static int __devinit ibwdt_probe(struct platform_device *dev)
return 0;

out_nomisc:
unregister_reboot_notifier(&ibwdt_notifier);
out_noreboot:
release_region(WDT_START, 1);
out_nostartreg:
#if WDT_START != WDT_STOP
Expand All @@ -378,17 +344,23 @@ static int __devinit ibwdt_probe(struct platform_device *dev)
static int __devexit ibwdt_remove(struct platform_device *dev)
{
misc_deregister(&ibwdt_miscdev);
unregister_reboot_notifier(&ibwdt_notifier);
release_region(WDT_START,1);
#if WDT_START != WDT_STOP
release_region(WDT_STOP,1);
#endif
return 0;
}

static void ibwdt_shutdown(struct platform_device *dev)
{
/* Turn the WDT off if we have a soft shutdown */
ibwdt_disable();
}

static struct platform_driver ibwdt_driver = {
.probe = ibwdt_probe,
.remove = __devexit_p(ibwdt_remove),
.shutdown = ibwdt_shutdown,
.driver = {
.owner = THIS_MODULE,
.name = DRV_NAME,
Expand Down

0 comments on commit abb3cf0

Please sign in to comment.