Commit 1bef84be authored by Wim Van Sebroeck's avatar Wim Van Sebroeck

[WATCHDOG] iTCO_wdt.c shutdown patch

Since we are using the device driver model,
we don't need to arrange the shutdown via a
reboot_notifier.
Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
parent 4802c653
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
/* Module and version information */ /* Module and version information */
#define DRV_NAME "iTCO_wdt" #define DRV_NAME "iTCO_wdt"
#define DRV_VERSION "1.00" #define DRV_VERSION "1.00"
#define DRV_RELDATE "19-Jul-2006" #define DRV_RELDATE "30-Jul-2006"
#define PFX DRV_NAME ": " #define PFX DRV_NAME ": "
/* Includes */ /* Includes */
...@@ -57,8 +57,6 @@ ...@@ -57,8 +57,6 @@
#include <linux/kernel.h> /* For printk/panic/... */ #include <linux/kernel.h> /* For printk/panic/... */
#include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */ #include <linux/miscdevice.h> /* For MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR) */
#include <linux/watchdog.h> /* For the watchdog specific items */ #include <linux/watchdog.h> /* For the watchdog specific items */
#include <linux/notifier.h> /* For notifier support */
#include <linux/reboot.h> /* For reboot_notifier stuff */
#include <linux/init.h> /* For __init/__exit/... */ #include <linux/init.h> /* For __init/__exit/... */
#include <linux/fs.h> /* For file operations */ #include <linux/fs.h> /* For file operations */
#include <linux/platform_device.h> /* For platform_driver framework */ #include <linux/platform_device.h> /* For platform_driver framework */
...@@ -500,20 +498,6 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file, ...@@ -500,20 +498,6 @@ static int iTCO_wdt_ioctl (struct inode *inode, struct file *file,
} }
} }
/*
* Notify system
*/
static int iTCO_wdt_notify_sys (struct notifier_block *this, unsigned long code, void *unused)
{
if (code==SYS_DOWN || code==SYS_HALT) {
/* Turn the WDT off */
iTCO_wdt_stop();
}
return NOTIFY_DONE;
}
/* /*
* Kernel Interfaces * Kernel Interfaces
*/ */
...@@ -533,10 +517,6 @@ static struct miscdevice iTCO_wdt_miscdev = { ...@@ -533,10 +517,6 @@ static struct miscdevice iTCO_wdt_miscdev = {
.fops = &iTCO_wdt_fops, .fops = &iTCO_wdt_fops,
}; };
static struct notifier_block iTCO_wdt_notifier = {
.notifier_call = iTCO_wdt_notify_sys,
};
/* /*
* Init & exit routines * Init & exit routines
*/ */
...@@ -623,18 +603,11 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, ...@@ -623,18 +603,11 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent,
heartbeat); heartbeat);
} }
ret = register_reboot_notifier(&iTCO_wdt_notifier);
if (ret != 0) {
printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n",
ret);
goto unreg_region;
}
ret = misc_register(&iTCO_wdt_miscdev); ret = misc_register(&iTCO_wdt_miscdev);
if (ret != 0) { if (ret != 0) {
printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n",
WATCHDOG_MINOR, ret); WATCHDOG_MINOR, ret);
goto unreg_notifier; goto unreg_region;
} }
printk (KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", printk (KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n",
...@@ -642,15 +615,13 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent, ...@@ -642,15 +615,13 @@ static int iTCO_wdt_init(struct pci_dev *pdev, const struct pci_device_id *ent,
return 0; return 0;
unreg_notifier:
unregister_reboot_notifier(&iTCO_wdt_notifier);
unreg_region: unreg_region:
release_region (TCOBASE, 0x20); release_region (TCOBASE, 0x20);
out: out:
if (iTCO_wdt_private.iTCO_version == 2) if (iTCO_wdt_private.iTCO_version == 2)
iounmap(iTCO_wdt_private.gcs); iounmap(iTCO_wdt_private.gcs);
iTCO_wdt_private.ACPIBASE = 0;
pci_dev_put(iTCO_wdt_private.pdev); pci_dev_put(iTCO_wdt_private.pdev);
iTCO_wdt_private.ACPIBASE = 0;
return ret; return ret;
} }
...@@ -662,11 +633,11 @@ static void iTCO_wdt_cleanup(void) ...@@ -662,11 +633,11 @@ static void iTCO_wdt_cleanup(void)
/* Deregister */ /* Deregister */
misc_deregister(&iTCO_wdt_miscdev); misc_deregister(&iTCO_wdt_miscdev);
unregister_reboot_notifier(&iTCO_wdt_notifier);
release_region(TCOBASE, 0x20); release_region(TCOBASE, 0x20);
if (iTCO_wdt_private.iTCO_version == 2) if (iTCO_wdt_private.iTCO_version == 2)
iounmap(iTCO_wdt_private.gcs); iounmap(iTCO_wdt_private.gcs);
pci_dev_put(iTCO_wdt_private.pdev); pci_dev_put(iTCO_wdt_private.pdev);
iTCO_wdt_private.ACPIBASE = 0;
} }
static int iTCO_wdt_probe(struct platform_device *dev) static int iTCO_wdt_probe(struct platform_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment