From 0426fd0d88a595a8ab18e0cd69bdfe82a4d15115 Mon Sep 17 00:00:00 2001 From: Wim Van Sebroeck Date: Thu, 19 Mar 2009 19:02:44 +0000 Subject: [WATCHDOG] i6300esb.c: convert to platform device driver Convert the Intel 6300ESB watchdog timer to a platform device driver. Signed-off-by: Wim Van Sebroeck --- drivers/watchdog/i6300esb.c | 90 ++++++++++++++++++++++++++++----------------- 1 file changed, 57 insertions(+), 33 deletions(-) (limited to 'drivers/watchdog') diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c index 97ac6bf42224..fbe852853248 100644 --- a/drivers/watchdog/i6300esb.c +++ b/drivers/watchdog/i6300esb.c @@ -13,7 +13,7 @@ * * The timer is implemented in the following I/O controller hubs: * (See the intel documentation on http://developer.intel.com.) - * 6300ESB chip : document number 300641-003 + * 6300ESB chip : document number 300641-004 * * 2004YYZZ Ross Biro * Initial version 0.01 @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ #include /* Module and version information */ -#define ESB_VERSION "0.03" +#define ESB_VERSION "0.04" #define ESB_MODULE_NAME "i6300ESB timer" #define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION #define PFX ESB_MODULE_NAME ": " @@ -81,6 +81,8 @@ static unsigned long timer_alive; static struct pci_dev *esb_pci; static unsigned short triggered; /* The status of the watchdog upon boot */ static char esb_expect_close; +static struct platform_device *esb_platform_device; + /* module parameters */ /* 30 sec default heartbeat (1 < heartbeat < 2*1023) */ @@ -319,19 +321,6 @@ static long esb_ioctl(struct file *file, unsigned int cmd, unsigned long arg) } } -/* - * Notify system - */ - -static int esb_notify_sys(struct notifier_block *this, - unsigned long code, void *unused) -{ - if (code == SYS_DOWN || code == SYS_HALT) - esb_timer_stop(); /* Turn the WDT off */ - - return NOTIFY_DONE; -} - /* * Kernel Interfaces */ @@ -351,10 +340,6 @@ static struct miscdevice esb_miscdev = { .fops = &esb_fops, }; -static struct notifier_block esb_notifier = { - .notifier_call = esb_notify_sys, -}; - /* * Data for PCI driver interface * @@ -373,7 +358,7 @@ MODULE_DEVICE_TABLE(pci, esb_pci_tbl); * Init & exit routines */ -static unsigned char __init esb_getdevice(void) +static unsigned char __devinit esb_getdevice(void) { u8 val1; unsigned short val2; @@ -444,7 +429,7 @@ err_devput: return 0; } -static int __init watchdog_init(void) +static int __devinit esb_probe(struct platform_device *dev) { int ret; @@ -460,19 +445,13 @@ static int __init watchdog_init(void) "heartbeat value must be 1