Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 48140
b: refs/heads/master
c: 98c08e9
h: refs/heads/master
v: v3
  • Loading branch information
Wim Van Sebroeck committed Jan 10, 2007
1 parent c8a29c6 commit 700fc5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 37 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: ad5fe323182fd3adab4225c93eae36f3c555a884
refs/heads/master: 98c08e98f8e5af1caf106e9ee3d46f3eb1ba4858
44 changes: 8 additions & 36 deletions trunk/drivers/char/watchdog/acquirewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@
#include <linux/watchdog.h> /* For the watchdog specific items */
#include <linux/fs.h> /* For file operations */
#include <linux/ioport.h> /* For io-port access */
#include <linux/notifier.h> /* For reboot notifier */
#include <linux/reboot.h> /* For reboot notifier */
#include <linux/platform_device.h> /* For platform_driver framework */
#include <linux/init.h> /* For __init/__exit/... */

Expand Down Expand Up @@ -221,20 +219,6 @@ static int acq_close(struct inode *inode, struct file *file)
return 0;
}

/*
* Notifier for system down
*/

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

/*
* Kernel Interfaces
*/
Expand All @@ -254,15 +238,6 @@ static struct miscdevice acq_miscdev = {
.fops = &acq_fops,
};

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

static struct notifier_block acq_notifier = {
.notifier_call = acq_notify_sys,
};

/*
* Init & exit routines
*/
Expand All @@ -287,27 +262,18 @@ static int __devinit acq_probe(struct platform_device *dev)
goto unreg_stop;
}

ret = register_reboot_notifier(&acq_notifier);
if (ret != 0) {
printk (KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
ret);
goto unreg_regions;
}

ret = misc_register(&acq_miscdev);
if (ret != 0) {
printk (KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret);
goto unreg_reboot;
goto unreg_regions;
}

printk (KERN_INFO PFX "initialized. (nowayout=%d)\n",
nowayout);

return 0;

unreg_reboot:
unregister_reboot_notifier(&acq_notifier);
unreg_regions:
release_region(wdt_start, 1);
unreg_stop:
Expand All @@ -320,17 +286,23 @@ static int __devinit acq_probe(struct platform_device *dev)
static int __devexit acq_remove(struct platform_device *dev)
{
misc_deregister(&acq_miscdev);
unregister_reboot_notifier(&acq_notifier);
release_region(wdt_start,1);
if(wdt_stop != wdt_start)
release_region(wdt_stop,1);

return 0;
}

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

static struct platform_driver acquirewdt_driver = {
.probe = acq_probe,
.remove = __devexit_p(acq_remove),
.shutdown = acq_shutdown,
.driver = {
.owner = THIS_MODULE,
.name = DRV_NAME,
Expand Down

0 comments on commit 700fc5b

Please sign in to comment.