aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog
diff options
context:
space:
mode:
authorWim Van Sebroeck <wim@iguana.be>2009-03-18 04:35:09 -0400
committerWim Van Sebroeck <wim@iguana.be>2009-03-25 05:07:04 -0400
commit143a2e54bf53216674eada16e8953f48b159e08a (patch)
tree009497fad6a7d28aae80f490007ce78736afb82c /drivers/watchdog
parentd5c26a597782d4109869abbcc36983969f964864 (diff)
[WATCHDOG] More coding-style and trivial clean-up
Some more cleaning-up of the watchdog drivers. Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r--drivers/watchdog/acquirewdt.c8
-rw-r--r--drivers/watchdog/advantechwdt.c7
-rw-r--r--drivers/watchdog/alim1535_wdt.c20
-rw-r--r--drivers/watchdog/alim7101_wdt.c6
-rw-r--r--drivers/watchdog/at91sam9_wdt.c2
-rw-r--r--drivers/watchdog/eurotechwdt.c22
-rw-r--r--drivers/watchdog/geodewdt.c11
-rw-r--r--drivers/watchdog/hpwdt.c3
-rw-r--r--drivers/watchdog/i6300esb.c3
-rw-r--r--drivers/watchdog/iTCO_vendor_support.c6
-rw-r--r--drivers/watchdog/iTCO_wdt.c15
-rw-r--r--drivers/watchdog/it87_wdt.c12
-rw-r--r--drivers/watchdog/mpc5200_wdt.c4
-rw-r--r--drivers/watchdog/mpcore_wdt.c2
-rw-r--r--drivers/watchdog/mtx-1_wdt.c2
-rw-r--r--drivers/watchdog/pc87413_wdt.c6
-rw-r--r--drivers/watchdog/pcwd.c44
-rw-r--r--drivers/watchdog/pcwd_pci.c108
-rw-r--r--drivers/watchdog/pcwd_usb.c171
-rw-r--r--drivers/watchdog/pnx4008_wdt.c18
-rw-r--r--drivers/watchdog/riowd.c3
-rw-r--r--drivers/watchdog/sa1100_wdt.c6
-rw-r--r--drivers/watchdog/sbc60xxwdt.c2
-rw-r--r--drivers/watchdog/sbc8360.c12
-rw-r--r--drivers/watchdog/sbc_epx_c3.c3
-rw-r--r--drivers/watchdog/sc1200wdt.c7
-rw-r--r--drivers/watchdog/sc520_wdt.c9
-rw-r--r--drivers/watchdog/smsc37b787_wdt.c30
-rw-r--r--drivers/watchdog/softdog.c5
-rw-r--r--drivers/watchdog/w83697hf_wdt.c3
-rw-r--r--drivers/watchdog/w83697ug_wdt.c2
-rw-r--r--drivers/watchdog/w83977f_wdt.c2
-rw-r--r--drivers/watchdog/wd501p.h24
-rw-r--r--drivers/watchdog/wdt977.c2
34 files changed, 344 insertions, 236 deletions
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c
index 3e57aa4d643a..4d18c874d963 100644
--- a/drivers/watchdog/acquirewdt.c
+++ b/drivers/watchdog/acquirewdt.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Acquire Single Board Computer Watchdog Timer driver 2 * Acquire Single Board Computer Watchdog Timer driver
3 * 3 *
4 * Based on wdt.c. Original copyright messages: 4 * Based on wdt.c. Original copyright messages:
5 * 5 *
6 * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>, 6 * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
7 * All Rights Reserved. 7 * All Rights Reserved.
@@ -17,9 +17,9 @@
17 * 17 *
18 * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> 18 * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>
19 * 19 *
20 * 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com> 20 * 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
21 * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT 21 * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
22 * Can't add timeout - driver doesn't allow changing value 22 * Can't add timeout - driver doesn't allow changing value
23 */ 23 */
24 24
25/* 25/*
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c
index a1d7856ea6e0..824d076a5cd6 100644
--- a/drivers/watchdog/advantechwdt.c
+++ b/drivers/watchdog/advantechwdt.c
@@ -138,7 +138,9 @@ static long advwdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
138 void __user *argp = (void __user *)arg; 138 void __user *argp = (void __user *)arg;
139 int __user *p = argp; 139 int __user *p = argp;
140 static struct watchdog_info ident = { 140 static struct watchdog_info ident = {
141 .options = WDIOF_KEEPALIVEPING | WDIOF_SETTIMEOUT | WDIOF_MAGICCLOSE, 141 .options = WDIOF_KEEPALIVEPING |
142 WDIOF_SETTIMEOUT |
143 WDIOF_MAGICCLOSE,
142 .firmware_version = 1, 144 .firmware_version = 1,
143 .identity = WATCHDOG_NAME, 145 .identity = WATCHDOG_NAME,
144 }; 146 };
@@ -259,7 +261,8 @@ static int __devinit advwdt_probe(struct platform_device *dev)
259 goto unreg_stop; 261 goto unreg_stop;
260 } 262 }
261 263
262 /* Check that the heartbeat value is within it's range ; if not reset to the default */ 264 /* Check that the heartbeat value is within it's range ;
265 * if not reset to the default */
263 if (advwdt_set_heartbeat(timeout)) { 266 if (advwdt_set_heartbeat(timeout)) {
264 advwdt_set_heartbeat(WATCHDOG_TIMEOUT); 267 advwdt_set_heartbeat(WATCHDOG_TIMEOUT);
265 printk(KERN_INFO PFX 268 printk(KERN_INFO PFX
diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c
index 2a7690ecf97d..937a80fb61e1 100644
--- a/drivers/watchdog/alim1535_wdt.c
+++ b/drivers/watchdog/alim1535_wdt.c
@@ -60,7 +60,7 @@ static void ali_start(void)
60 60
61 pci_read_config_dword(ali_pci, 0xCC, &val); 61 pci_read_config_dword(ali_pci, 0xCC, &val);
62 val &= ~0x3F; /* Mask count */ 62 val &= ~0x3F; /* Mask count */
63 val |= (1<<25) | ali_timeout_bits; 63 val |= (1 << 25) | ali_timeout_bits;
64 pci_write_config_dword(ali_pci, 0xCC, val); 64 pci_write_config_dword(ali_pci, 0xCC, val);
65 65
66 spin_unlock(&ali_lock); 66 spin_unlock(&ali_lock);
@@ -79,8 +79,8 @@ static void ali_stop(void)
79 spin_lock(&ali_lock); 79 spin_lock(&ali_lock);
80 80
81 pci_read_config_dword(ali_pci, 0xCC, &val); 81 pci_read_config_dword(ali_pci, 0xCC, &val);
82 val &= ~0x3F; /* Mask count to zero (disabled) */ 82 val &= ~0x3F; /* Mask count to zero (disabled) */
83 val &= ~(1<<25);/* and for safety mask the reset enable */ 83 val &= ~(1 << 25); /* and for safety mask the reset enable */
84 pci_write_config_dword(ali_pci, 0xCC, val); 84 pci_write_config_dword(ali_pci, 0xCC, val);
85 85
86 spin_unlock(&ali_lock); 86 spin_unlock(&ali_lock);
@@ -89,7 +89,7 @@ static void ali_stop(void)
89/* 89/*
90 * ali_keepalive - send a keepalive to the watchdog 90 * ali_keepalive - send a keepalive to the watchdog
91 * 91 *
92 * Send a keepalive to the timer (actually we restart the timer). 92 * Send a keepalive to the timer (actually we restart the timer).
93 */ 93 */
94 94
95static void ali_keepalive(void) 95static void ali_keepalive(void)
@@ -109,11 +109,11 @@ static int ali_settimer(int t)
109 if (t < 0) 109 if (t < 0)
110 return -EINVAL; 110 return -EINVAL;
111 else if (t < 60) 111 else if (t < 60)
112 ali_timeout_bits = t|(1<<6); 112 ali_timeout_bits = t|(1 << 6);
113 else if (t < 3600) 113 else if (t < 3600)
114 ali_timeout_bits = (t/60)|(1<<7); 114 ali_timeout_bits = (t / 60)|(1 << 7);
115 else if (t < 18000) 115 else if (t < 18000)
116 ali_timeout_bits = (t/300)|(1<<6)|(1<<7); 116 ali_timeout_bits = (t / 300)|(1 << 6)|(1 << 7);
117 else 117 else
118 return -EINVAL; 118 return -EINVAL;
119 119
@@ -138,7 +138,7 @@ static int ali_settimer(int t)
138 */ 138 */
139 139
140static ssize_t ali_write(struct file *file, const char __user *data, 140static ssize_t ali_write(struct file *file, const char __user *data,
141 size_t len, loff_t *ppos) 141 size_t len, loff_t *ppos)
142{ 142{
143 /* See if we got the magic character 'V' and reload the timer */ 143 /* See if we got the magic character 'V' and reload the timer */
144 if (len) { 144 if (len) {
@@ -348,9 +348,9 @@ static int __init ali_find_watchdog(void)
348 /* Timer bits */ 348 /* Timer bits */
349 wdog &= ~0x3F; 349 wdog &= ~0x3F;
350 /* Issued events */ 350 /* Issued events */
351 wdog &= ~((1<<27)|(1<<26)|(1<<25)|(1<<24)); 351 wdog &= ~((1 << 27)|(1 << 26)|(1 << 25)|(1 << 24));
352 /* No monitor bits */ 352 /* No monitor bits */
353 wdog &= ~((1<<16)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)); 353 wdog &= ~((1 << 16)|(1 << 13)|(1 << 12)|(1 << 11)|(1 << 10)|(1 << 9));
354 354
355 pci_write_config_dword(pdev, 0xCC, wdog); 355 pci_write_config_dword(pdev, 0xCC, wdog);
356 356
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c
index a045ef869439..90f98df5f106 100644
--- a/drivers/watchdog/alim7101_wdt.c
+++ b/drivers/watchdog/alim7101_wdt.c
@@ -355,7 +355,8 @@ static int __init alim7101_wdt_init(void)
355 alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 355 alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
356 NULL); 356 NULL);
357 if (!alim7101_pmu) { 357 if (!alim7101_pmu) {
358 printk(KERN_INFO PFX "ALi M7101 PMU not present - WDT not set\n"); 358 printk(KERN_INFO PFX
359 "ALi M7101 PMU not present - WDT not set\n");
359 return -EBUSY; 360 return -EBUSY;
360 } 361 }
361 362
@@ -399,7 +400,8 @@ static int __init alim7101_wdt_init(void)
399 400
400 rc = misc_register(&wdt_miscdev); 401 rc = misc_register(&wdt_miscdev);
401 if (rc) { 402 if (rc) {
402 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 403 printk(KERN_ERR PFX
404 "cannot register miscdev on minor=%d (err=%d)\n",
403 wdt_miscdev.minor, rc); 405 wdt_miscdev.minor, rc);
404 goto err_out_reboot; 406 goto err_out_reboot;
405 } 407 }
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c
index a56ac84381b1..435b0573fb0a 100644
--- a/drivers/watchdog/at91sam9_wdt.c
+++ b/drivers/watchdog/at91sam9_wdt.c
@@ -201,7 +201,7 @@ static long at91_wdt_ioctl(struct file *file,
201 * Pat the watchdog whenever device is written to. 201 * Pat the watchdog whenever device is written to.
202 */ 202 */
203static ssize_t at91_wdt_write(struct file *file, const char *data, size_t len, 203static ssize_t at91_wdt_write(struct file *file, const char *data, size_t len,
204 loff_t *ppos) 204 loff_t *ppos)
205{ 205{
206 if (!len) 206 if (!len)
207 return 0; 207 return 0;
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c
index a171fc6ae1cb..9add3541fb42 100644
--- a/drivers/watchdog/eurotechwdt.c
+++ b/drivers/watchdog/eurotechwdt.c
@@ -8,19 +8,19 @@
8 * Based on wdt.c. 8 * Based on wdt.c.
9 * Original copyright messages: 9 * Original copyright messages:
10 * 10 *
11 * (c) Copyright 1996-1997 Alan Cox <alan@lxorguk.ukuu.org.uk>, 11 * (c) Copyright 1996-1997 Alan Cox <alan@lxorguk.ukuu.org.uk>,
12 * All Rights Reserved. 12 * All Rights Reserved.
13 * 13 *
14 * This program is free software; you can redistribute it and/or 14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License 15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 16 * as published by the Free Software Foundation; either version
17 * 2 of the License, or (at your option) any later version. 17 * 2 of the License, or (at your option) any later version.
18 * 18 *
19 * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide 19 * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
20 * warranty for any of this software. This material is provided 20 * warranty for any of this software. This material is provided
21 * "AS-IS" and at no charge. 21 * "AS-IS" and at no charge.
22 * 22 *
23 * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>* 23 * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>*
24 */ 24 */
25 25
26/* Changelog: 26/* Changelog:
@@ -37,7 +37,7 @@
37 * add expect_close support 37 * add expect_close support
38 * 38 *
39 * 2002.05.30 - Joel Becker <joel.becker@oracle.com> 39 * 2002.05.30 - Joel Becker <joel.becker@oracle.com>
40 * Added Matt Domsch's nowayout module option. 40 * Added Matt Domsch's nowayout module option.
41 */ 41 */
42 42
43/* 43/*
@@ -151,7 +151,7 @@ static void eurwdt_activate_timer(void)
151 if (irq == 0) 151 if (irq == 0)
152 printk(KERN_INFO ": interrupt disabled\n"); 152 printk(KERN_INFO ": interrupt disabled\n");
153 153
154 eurwdt_write_reg(WDT_TIMER_CFG, irq<<4); 154 eurwdt_write_reg(WDT_TIMER_CFG, irq << 4);
155 155
156 eurwdt_write_reg(WDT_UNIT_SEL, WDT_UNIT_SECS); /* we use seconds */ 156 eurwdt_write_reg(WDT_UNIT_SEL, WDT_UNIT_SECS); /* we use seconds */
157 eurwdt_set_timeout(0); /* the default timeout */ 157 eurwdt_set_timeout(0); /* the default timeout */
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c
index 6799a6de66fe..9acf0015a1e7 100644
--- a/drivers/watchdog/geodewdt.c
+++ b/drivers/watchdog/geodewdt.c
@@ -34,11 +34,15 @@
34 34
35static int timeout = WATCHDOG_TIMEOUT; 35static int timeout = WATCHDOG_TIMEOUT;
36module_param(timeout, int, 0); 36module_param(timeout, int, 0);
37MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. 1<= timeout <=131, default=" __MODULE_STRING(WATCHDOG_TIMEOUT) "."); 37MODULE_PARM_DESC(timeout,
38 "Watchdog timeout in seconds. 1<= timeout <=131, default="
39 __MODULE_STRING(WATCHDOG_TIMEOUT) ".");
38 40
39static int nowayout = WATCHDOG_NOWAYOUT; 41static int nowayout = WATCHDOG_NOWAYOUT;
40module_param(nowayout, int, 0); 42module_param(nowayout, int, 0);
41MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 43MODULE_PARM_DESC(nowayout,
44 "Watchdog cannot be stopped once started (default="
45 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
42 46
43static struct platform_device *geodewdt_platform_device; 47static struct platform_device *geodewdt_platform_device;
44static unsigned long wdt_flags; 48static unsigned long wdt_flags;
@@ -269,7 +273,8 @@ static int __init geodewdt_init(void)
269 if (ret) 273 if (ret)
270 return ret; 274 return ret;
271 275
272 geodewdt_platform_device = platform_device_register_simple(DRV_NAME, -1, NULL, 0); 276 geodewdt_platform_device = platform_device_register_simple(DRV_NAME,
277 -1, NULL, 0);
273 if (IS_ERR(geodewdt_platform_device)) { 278 if (IS_ERR(geodewdt_platform_device)) {
274 ret = PTR_ERR(geodewdt_platform_device); 279 ret = PTR_ERR(geodewdt_platform_device);
275 goto err; 280 goto err;
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c
index 7cf32ad96fd1..6cf155d6b350 100644
--- a/drivers/watchdog/hpwdt.c
+++ b/drivers/watchdog/hpwdt.c
@@ -137,7 +137,8 @@ static struct pci_device_id hpwdt_devices[] = {
137}; 137};
138MODULE_DEVICE_TABLE(pci, hpwdt_devices); 138MODULE_DEVICE_TABLE(pci, hpwdt_devices);
139 139
140extern asmlinkage void asminline_call(struct cmn_registers *pi86Regs, unsigned long *pRomEntry); 140extern asmlinkage void asminline_call(struct cmn_registers *pi86Regs,
141 unsigned long *pRomEntry);
141 142
142#ifndef CONFIG_X86_64 143#ifndef CONFIG_X86_64
143/* --32 Bit Bios------------------------------------------------------------ */ 144/* --32 Bit Bios------------------------------------------------------------ */
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c
index 74f951c18b90..97ac6bf42224 100644
--- a/drivers/watchdog/i6300esb.c
+++ b/drivers/watchdog/i6300esb.c
@@ -240,7 +240,8 @@ static ssize_t esb_write(struct file *file, const char __user *data,
240 * five months ago... */ 240 * five months ago... */
241 esb_expect_close = 0; 241 esb_expect_close = 0;
242 242
243 /* scan to see whether or not we got the magic character */ 243 /* scan to see whether or not we got the
244 * magic character */
244 for (i = 0; i != len; i++) { 245 for (i = 0; i != len; i++) {
245 char c; 246 char c;
246 if (get_user(c, data + i)) 247 if (get_user(c, data + i))
diff --git a/drivers/watchdog/iTCO_vendor_support.c b/drivers/watchdog/iTCO_vendor_support.c
index d8264ad0be41..d3c0f6de5523 100644
--- a/drivers/watchdog/iTCO_vendor_support.c
+++ b/drivers/watchdog/iTCO_vendor_support.c
@@ -47,7 +47,8 @@
47 47
48static int vendorsupport; 48static int vendorsupport;
49module_param(vendorsupport, int, 0); 49module_param(vendorsupport, int, 0);
50MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default=0 (none), 1=SuperMicro Pent3, 2=SuperMicro Pent4+"); 50MODULE_PARM_DESC(vendorsupport, "iTCO vendor specific support mode, default="
51 "0 (none), 1=SuperMicro Pent3, 2=SuperMicro Pent4+");
51 52
52/* 53/*
53 * Vendor Specific Support 54 * Vendor Specific Support
@@ -305,7 +306,8 @@ static void __exit iTCO_vendor_exit_module(void)
305module_init(iTCO_vendor_init_module); 306module_init(iTCO_vendor_init_module);
306module_exit(iTCO_vendor_exit_module); 307module_exit(iTCO_vendor_exit_module);
307 308
308MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>, R. Seretny <lkpatches@paypc.com>"); 309MODULE_AUTHOR("Wim Van Sebroeck <wim@iguana.be>, "
310 "R. Seretny <lkpatches@paypc.com>");
309MODULE_DESCRIPTION("Intel TCO Vendor Specific WatchDog Timer Driver Support"); 311MODULE_DESCRIPTION("Intel TCO Vendor Specific WatchDog Timer Driver Support");
310MODULE_VERSION(DRV_VERSION); 312MODULE_VERSION(DRV_VERSION);
311MODULE_LICENSE("GPL"); 313MODULE_LICENSE("GPL");
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index 352334947ea3..648250b998c4 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -273,7 +273,9 @@ static struct platform_device *iTCO_wdt_platform_device;
273#define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */ 273#define WATCHDOG_HEARTBEAT 30 /* 30 sec default heartbeat */
274static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */ 274static int heartbeat = WATCHDOG_HEARTBEAT; /* in seconds */
275module_param(heartbeat, int, 0); 275module_param(heartbeat, int, 0);
276MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2<heartbeat<39 (TCO v1) or 613 (TCO v2), default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); 276MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. "
277 "(2<heartbeat<39 (TCO v1) or 613 (TCO v2), default="
278 __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
277 279
278static int nowayout = WATCHDOG_NOWAYOUT; 280static int nowayout = WATCHDOG_NOWAYOUT;
279module_param(nowayout, int, 0); 281module_param(nowayout, int, 0);
@@ -346,7 +348,8 @@ static int iTCO_wdt_start(void)
346 /* disable chipset's NO_REBOOT bit */ 348 /* disable chipset's NO_REBOOT bit */
347 if (iTCO_wdt_unset_NO_REBOOT_bit()) { 349 if (iTCO_wdt_unset_NO_REBOOT_bit()) {
348 spin_unlock(&iTCO_wdt_private.io_lock); 350 spin_unlock(&iTCO_wdt_private.io_lock);
349 printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n"); 351 printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, "
352 "reboot disabled by hardware\n");
350 return -EIO; 353 return -EIO;
351 } 354 }
352 355
@@ -669,7 +672,8 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
669 672
670 /* Check chipset's NO_REBOOT bit */ 673 /* Check chipset's NO_REBOOT bit */
671 if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) { 674 if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) {
672 printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n"); 675 printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, "
676 "reboot disabled by hardware\n");
673 ret = -ENODEV; /* Cannot reset NO_REBOOT bit */ 677 ret = -ENODEV; /* Cannot reset NO_REBOOT bit */
674 goto out; 678 goto out;
675 } 679 }
@@ -716,8 +720,9 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev,
716 if not reset to the default */ 720 if not reset to the default */
717 if (iTCO_wdt_set_heartbeat(heartbeat)) { 721 if (iTCO_wdt_set_heartbeat(heartbeat)) {
718 iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT); 722 iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT);
719 printk(KERN_INFO PFX "heartbeat value must be 2 < heartbeat < 39 (TCO v1) or 613 (TCO v2), using %d\n", 723 printk(KERN_INFO PFX
720 heartbeat); 724 "heartbeat value must be 2 < heartbeat < 39 (TCO v1) "
725 "or 613 (TCO v2), using %d\n", heartbeat);
721 } 726 }
722 727
723 ret = misc_register(&iTCO_wdt_miscdev); 728 ret = misc_register(&iTCO_wdt_miscdev);
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c
index afb8af397a9f..cc133c531d08 100644
--- a/drivers/watchdog/it87_wdt.c
+++ b/drivers/watchdog/it87_wdt.c
@@ -188,8 +188,8 @@ static inline int superio_inb(int reg)
188 188
189static inline void superio_outb(int val, int reg) 189static inline void superio_outb(int val, int reg)
190{ 190{
191 outb(reg, REG); 191 outb(reg, REG);
192 outb(val, VAL); 192 outb(val, VAL);
193} 193}
194 194
195static inline int superio_inw(int reg) 195static inline int superio_inw(int reg)
@@ -204,10 +204,10 @@ static inline int superio_inw(int reg)
204 204
205static inline void superio_outw(int val, int reg) 205static inline void superio_outw(int val, int reg)
206{ 206{
207 outb(reg++, REG); 207 outb(reg++, REG);
208 outb(val >> 8, VAL); 208 outb(val >> 8, VAL);
209 outb(reg, REG); 209 outb(reg, REG);
210 outb(val, VAL); 210 outb(val, VAL);
211} 211}
212 212
213/* watchdog timer handling */ 213/* watchdog timer handling */
diff --git a/drivers/watchdog/mpc5200_wdt.c b/drivers/watchdog/mpc5200_wdt.c
index db91892558f2..465fe36adad4 100644
--- a/drivers/watchdog/mpc5200_wdt.c
+++ b/drivers/watchdog/mpc5200_wdt.c
@@ -9,8 +9,8 @@
9#include <asm/mpc52xx.h> 9#include <asm/mpc52xx.h>
10 10
11 11
12#define GPT_MODE_WDT (1<<15) 12#define GPT_MODE_WDT (1 << 15)
13#define GPT_MODE_CE (1<<12) 13#define GPT_MODE_CE (1 << 12)
14#define GPT_MODE_MS_TIMER (0x4) 14#define GPT_MODE_MS_TIMER (0x4)
15 15
16 16
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c
index 1130ad697ce2..1512ab8b175b 100644
--- a/drivers/watchdog/mpcore_wdt.c
+++ b/drivers/watchdog/mpcore_wdt.c
@@ -5,7 +5,7 @@
5 * 5 *
6 * Based on the SoftDog driver: 6 * Based on the SoftDog driver:
7 * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>, 7 * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
8 * All Rights Reserved. 8 * All Rights Reserved.
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/drivers/watchdog/mtx-1_wdt.c b/drivers/watchdog/mtx-1_wdt.c
index 3acce623f209..539b6f6ba7f1 100644
--- a/drivers/watchdog/mtx-1_wdt.c
+++ b/drivers/watchdog/mtx-1_wdt.c
@@ -5,7 +5,7 @@
5 * All Rights Reserved. 5 * All Rights Reserved.
6 * http://www.4g-systems.biz 6 * http://www.4g-systems.biz
7 * 7 *
8 * (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org> 8 * (C) Copyright 2007 OpenWrt.org, Florian Fainelli <florian@openwrt.org>
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c
index 484c215e9f3f..1a2b916e3f8d 100644
--- a/drivers/watchdog/pc87413_wdt.c
+++ b/drivers/watchdog/pc87413_wdt.c
@@ -536,7 +536,8 @@ static int __init pc87413_init(void)
536 536
537 ret = misc_register(&pc87413_miscdev); 537 ret = misc_register(&pc87413_miscdev);
538 if (ret != 0) { 538 if (ret != 0) {
539 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 539 printk(KERN_ERR PFX
540 "cannot register miscdev on minor=%d (err=%d)\n",
540 WATCHDOG_MINOR, ret); 541 WATCHDOG_MINOR, ret);
541 unregister_reboot_notifier(&pc87413_notifier); 542 unregister_reboot_notifier(&pc87413_notifier);
542 return ret; 543 return ret;
@@ -574,7 +575,8 @@ static void __exit pc87413_exit(void)
574module_init(pc87413_init); 575module_init(pc87413_init);
575module_exit(pc87413_exit); 576module_exit(pc87413_exit);
576 577
577MODULE_AUTHOR("Sven Anders <anders@anduras.de>, Marcus Junker <junker@anduras.de>,"); 578MODULE_AUTHOR("Sven Anders <anders@anduras.de>, "
579 "Marcus Junker <junker@anduras.de>,");
578MODULE_DESCRIPTION("PC87413 WDT driver"); 580MODULE_DESCRIPTION("PC87413 WDT driver");
579MODULE_LICENSE("GPL"); 581MODULE_LICENSE("GPL");
580 582
diff --git a/drivers/watchdog/pcwd.c b/drivers/watchdog/pcwd.c
index 9e1331a3b215..aa9512321f3a 100644
--- a/drivers/watchdog/pcwd.c
+++ b/drivers/watchdog/pcwd.c
@@ -24,25 +24,25 @@
24 * version reporting. Added read routine for temperature. 24 * version reporting. Added read routine for temperature.
25 * Removed some extra defines, added an autodetect Revision 25 * Removed some extra defines, added an autodetect Revision
26 * routine. 26 * routine.
27 * 961006 Revised some documentation, fixed some cosmetic bugs. Made 27 * 961006 Revised some documentation, fixed some cosmetic bugs. Made
28 * drivers to panic the system if it's overheating at bootup. 28 * drivers to panic the system if it's overheating at bootup.
29 * 961118 Changed some verbiage on some of the output, tidied up 29 * 961118 Changed some verbiage on some of the output, tidied up
30 * code bits, and added compatibility to 2.1.x. 30 * code bits, and added compatibility to 2.1.x.
31 * 970912 Enabled board on open and disable on close. 31 * 970912 Enabled board on open and disable on close.
32 * 971107 Took account of recent VFS changes (broke read). 32 * 971107 Took account of recent VFS changes (broke read).
33 * 971210 Disable board on initialisation in case board already ticking. 33 * 971210 Disable board on initialisation in case board already ticking.
34 * 971222 Changed open/close for temperature handling 34 * 971222 Changed open/close for temperature handling
35 * Michael Meskes <meskes@debian.org>. 35 * Michael Meskes <meskes@debian.org>.
36 * 980112 Used minor numbers from include/linux/miscdevice.h 36 * 980112 Used minor numbers from include/linux/miscdevice.h
37 * 990403 Clear reset status after reading control status register in 37 * 990403 Clear reset status after reading control status register in
38 * pcwd_showprevstate(). [Marc Boucher <marc@mbsi.ca>] 38 * pcwd_showprevstate(). [Marc Boucher <marc@mbsi.ca>]
39 * 990605 Made changes to code to support Firmware 1.22a, added 39 * 990605 Made changes to code to support Firmware 1.22a, added
40 * fairly useless proc entry. 40 * fairly useless proc entry.
41 * 990610 removed said useless proc code for the merge <alan> 41 * 990610 removed said useless proc code for the merge <alan>
42 * 000403 Removed last traces of proc code. <davej> 42 * 000403 Removed last traces of proc code. <davej>
43 * 011214 Added nowayout module option to override 43 * 011214 Added nowayout module option to override
44 * CONFIG_WATCHDOG_NOWAYOUT <Matt_Domsch@dell.com> 44 * CONFIG_WATCHDOG_NOWAYOUT <Matt_Domsch@dell.com>
45 * Added timeout module option to override default 45 * Added timeout module option to override default
46 */ 46 */
47 47
48/* 48/*
@@ -76,8 +76,7 @@
76#define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog" 76#define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog"
77#define WATCHDOG_NAME "pcwd" 77#define WATCHDOG_NAME "pcwd"
78#define PFX WATCHDOG_NAME ": " 78#define PFX WATCHDOG_NAME ": "
79#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n" 79#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n"
80#define WD_VER WATCHDOG_VERSION " (" WATCHDOG_DATE ")"
81 80
82/* 81/*
83 * It should be noted that PCWD_REVISION_B was removed because A and B 82 * It should be noted that PCWD_REVISION_B was removed because A and B
@@ -200,7 +199,9 @@ MODULE_PARM_DESC(debug,
200#define WATCHDOG_HEARTBEAT 0 199#define WATCHDOG_HEARTBEAT 0
201static int heartbeat = WATCHDOG_HEARTBEAT; 200static int heartbeat = WATCHDOG_HEARTBEAT;
202module_param(heartbeat, int, 0); 201module_param(heartbeat, int, 0);
203MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (2 <= heartbeat <= 7200 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); 202MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. "
203 "(2 <= heartbeat <= 7200 or 0=delay-time from dip-switches, default="
204 __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
204 205
205static int nowayout = WATCHDOG_NOWAYOUT; 206static int nowayout = WATCHDOG_NOWAYOUT;
206module_param(nowayout, int, 0); 207module_param(nowayout, int, 0);
@@ -239,7 +240,8 @@ static int send_isa_command(int cmd)
239 } 240 }
240 241
241 if (debug >= DEBUG) 242 if (debug >= DEBUG)
242 printk(KERN_DEBUG PFX "received following data for cmd=0x%02x: port0=0x%02x last_port0=0x%02x\n", 243 printk(KERN_DEBUG PFX "received following data for "
244 "cmd=0x%02x: port0=0x%02x last_port0=0x%02x\n",
243 cmd, port0, last_port0); 245 cmd, port0, last_port0);
244 246
245 return port0; 247 return port0;
@@ -339,10 +341,12 @@ static void pcwd_show_card_info(void)
339 pcwd_private.io_addr); 341 pcwd_private.io_addr);
340 else if (pcwd_private.revision == PCWD_REVISION_C) { 342 else if (pcwd_private.revision == PCWD_REVISION_C) {
341 pcwd_get_firmware(); 343 pcwd_get_firmware();
342 printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n", 344 printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port "
345 "0x%04x (Firmware version: %s)\n",
343 pcwd_private.io_addr, pcwd_private.fw_ver_str); 346 pcwd_private.io_addr, pcwd_private.fw_ver_str);
344 option_switches = pcwd_get_option_switches(); 347 option_switches = pcwd_get_option_switches();
345 printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", 348 printk(KERN_INFO PFX "Option switches (0x%02x): "
349 "Temperature Reset Enable=%s, Power On Delay=%s\n",
346 option_switches, 350 option_switches,
347 ((option_switches & 0x10) ? "ON" : "OFF"), 351 ((option_switches & 0x10) ? "ON" : "OFF"),
348 ((option_switches & 0x08) ? "ON" : "OFF")); 352 ((option_switches & 0x08) ? "ON" : "OFF"));
@@ -358,7 +362,8 @@ static void pcwd_show_card_info(void)
358 printk(KERN_INFO PFX "Temperature Option Detected\n"); 362 printk(KERN_INFO PFX "Temperature Option Detected\n");
359 363
360 if (pcwd_private.boot_status & WDIOF_CARDRESET) 364 if (pcwd_private.boot_status & WDIOF_CARDRESET)
361 printk(KERN_INFO PFX "Previous reboot was caused by the card\n"); 365 printk(KERN_INFO PFX
366 "Previous reboot was caused by the card\n");
362 367
363 if (pcwd_private.boot_status & WDIOF_OVERHEAT) { 368 if (pcwd_private.boot_status & WDIOF_OVERHEAT) {
364 printk(KERN_EMERG PFX 369 printk(KERN_EMERG PFX
@@ -871,7 +876,7 @@ static int __devinit pcwd_isa_probe(struct device *dev, unsigned int id)
871 cards_found++; 876 cards_found++;
872 if (cards_found == 1) 877 if (cards_found == 1)
873 printk(KERN_INFO PFX "v%s Ken Hollis (kenji@bitgate.com)\n", 878 printk(KERN_INFO PFX "v%s Ken Hollis (kenji@bitgate.com)\n",
874 WD_VER); 879 WATCHDOG_VERSION);
875 880
876 if (cards_found > 1) { 881 if (cards_found > 1) {
877 printk(KERN_ERR PFX "This driver only supports 1 device\n"); 882 printk(KERN_ERR PFX "This driver only supports 1 device\n");
@@ -1026,7 +1031,8 @@ static void __exit pcwd_cleanup_module(void)
1026module_init(pcwd_init_module); 1031module_init(pcwd_init_module);
1027module_exit(pcwd_cleanup_module); 1032module_exit(pcwd_cleanup_module);
1028 1033
1029MODULE_AUTHOR("Ken Hollis <kenji@bitgate.com>, Wim Van Sebroeck <wim@iguana.be>"); 1034MODULE_AUTHOR("Ken Hollis <kenji@bitgate.com>, "
1035 "Wim Van Sebroeck <wim@iguana.be>");
1030MODULE_DESCRIPTION("Berkshire ISA-PC Watchdog driver"); 1036MODULE_DESCRIPTION("Berkshire ISA-PC Watchdog driver");
1031MODULE_VERSION(WATCHDOG_VERSION); 1037MODULE_VERSION(WATCHDOG_VERSION);
1032MODULE_LICENSE("GPL"); 1038MODULE_LICENSE("GPL");
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c
index 5d76422c402c..698f51bff1bc 100644
--- a/drivers/watchdog/pcwd_pci.c
+++ b/drivers/watchdog/pcwd_pci.c
@@ -24,7 +24,8 @@
24 * A bells and whistles driver is available from: 24 * A bells and whistles driver is available from:
25 * http://www.kernel.org/pub/linux/kernel/people/wim/pcwd/pcwd_pci/ 25 * http://www.kernel.org/pub/linux/kernel/people/wim/pcwd/pcwd_pci/
26 * 26 *
27 * More info available at http://www.berkprod.com/ or http://www.pcwatchdog.com/ 27 * More info available at
28 * http://www.berkprod.com/ or http://www.pcwatchdog.com/
28 */ 29 */
29 30
30/* 31/*
@@ -51,11 +52,10 @@
51 52
52/* Module and version information */ 53/* Module and version information */
53#define WATCHDOG_VERSION "1.03" 54#define WATCHDOG_VERSION "1.03"
54#define WATCHDOG_DATE "21 Jan 2007"
55#define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" 55#define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog"
56#define WATCHDOG_NAME "pcwd_pci" 56#define WATCHDOG_NAME "pcwd_pci"
57#define PFX WATCHDOG_NAME ": " 57#define PFX WATCHDOG_NAME ": "
58#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION " (" WATCHDOG_DATE ")\n" 58#define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n"
59 59
60/* Stuff for the PCI ID's */ 60/* Stuff for the PCI ID's */
61#ifndef PCI_VENDOR_ID_QUICKLOGIC 61#ifndef PCI_VENDOR_ID_QUICKLOGIC
@@ -76,7 +76,8 @@
76#define WD_PCI_TTRP 0x04 /* Temperature Trip status */ 76#define WD_PCI_TTRP 0x04 /* Temperature Trip status */
77#define WD_PCI_RL2A 0x08 /* Relay 2 Active */ 77#define WD_PCI_RL2A 0x08 /* Relay 2 Active */
78#define WD_PCI_RL1A 0x10 /* Relay 1 Active */ 78#define WD_PCI_RL1A 0x10 /* Relay 1 Active */
79#define WD_PCI_R2DS 0x40 /* Relay 2 Disable Temperature-trip/reset */ 79#define WD_PCI_R2DS 0x40 /* Relay 2 Disable Temperature-trip /
80 reset */
80#define WD_PCI_RLY2 0x80 /* Activate Relay 2 on the board */ 81#define WD_PCI_RLY2 0x80 /* Activate Relay 2 on the board */
81/* Port 2 : Control Status #2 */ 82/* Port 2 : Control Status #2 */
82#define WD_PCI_WDIS 0x10 /* Watchdog Disable */ 83#define WD_PCI_WDIS 0x10 /* Watchdog Disable */
@@ -114,12 +115,18 @@ static int cards_found;
114static int temp_panic; 115static int temp_panic;
115static unsigned long is_active; 116static unsigned long is_active;
116static char expect_release; 117static char expect_release;
117static struct { /* this is private data for each PCI-PC watchdog card */ 118/* this is private data for each PCI-PC watchdog card */
118 int supports_temp; /* Wether or not the card has a temperature device */ 119static struct {
119 int boot_status; /* The card's boot status */ 120 /* Wether or not the card has a temperature device */
120 unsigned long io_addr; /* The cards I/O address */ 121 int supports_temp;
121 spinlock_t io_lock; /* the lock for io operations */ 122 /* The card's boot status */
122 struct pci_dev *pdev; /* the PCI-device */ 123 int boot_status;
124 /* The cards I/O address */
125 unsigned long io_addr;
126 /* the lock for io operations */
127 spinlock_t io_lock;
128 /* the PCI-device */
129 struct pci_dev *pdev;
123} pcipcwd_private; 130} pcipcwd_private;
124 131
125/* module parameters */ 132/* module parameters */
@@ -130,14 +137,18 @@ static int debug = QUIET;
130module_param(debug, int, 0); 137module_param(debug, int, 0);
131MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)"); 138MODULE_PARM_DESC(debug, "Debug level: 0=Quiet, 1=Verbose, 2=Debug (default=0)");
132 139
133#define WATCHDOG_HEARTBEAT 0 /* default heartbeat = delay-time from dip-switches */ 140#define WATCHDOG_HEARTBEAT 0 /* default heartbeat =
141 delay-time from dip-switches */
134static int heartbeat = WATCHDOG_HEARTBEAT; 142static int heartbeat = WATCHDOG_HEARTBEAT;
135module_param(heartbeat, int, 0); 143module_param(heartbeat, int, 0);
136MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); 144MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. "
145 "(0<heartbeat<65536 or 0=delay-time from dip-switches, default="
146 __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
137 147
138static int nowayout = WATCHDOG_NOWAYOUT; 148static int nowayout = WATCHDOG_NOWAYOUT;
139module_param(nowayout, int, 0); 149module_param(nowayout, int, 0);
140MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 150MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
151 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
141 152
142/* 153/*
143 * Internal functions 154 * Internal functions
@@ -148,8 +159,8 @@ static int send_command(int cmd, int *msb, int *lsb)
148 int got_response, count; 159 int got_response, count;
149 160
150 if (debug >= DEBUG) 161 if (debug >= DEBUG)
151 printk(KERN_DEBUG PFX "sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x\n", 162 printk(KERN_DEBUG PFX "sending following data "
152 cmd, *msb, *lsb); 163 "cmd=0x%02x msb=0x%02x lsb=0x%02x\n", cmd, *msb, *lsb);
153 164
154 spin_lock(&pcipcwd_private.io_lock); 165 spin_lock(&pcipcwd_private.io_lock);
155 /* If a command requires data it should be written first. 166 /* If a command requires data it should be written first.
@@ -166,17 +177,20 @@ static int send_command(int cmd, int *msb, int *lsb)
166 * the WRSP bit in port 2 and give it a max. timeout of 177 * the WRSP bit in port 2 and give it a max. timeout of
167 * PCI_COMMAND_TIMEOUT to process */ 178 * PCI_COMMAND_TIMEOUT to process */
168 got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP; 179 got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP;
169 for (count = 0; (count < PCI_COMMAND_TIMEOUT) && (!got_response); count++) { 180 for (count = 0; (count < PCI_COMMAND_TIMEOUT) && (!got_response);
181 count++) {
170 mdelay(1); 182 mdelay(1);
171 got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP; 183 got_response = inb_p(pcipcwd_private.io_addr + 2) & WD_PCI_WRSP;
172 } 184 }
173 185
174 if (debug >= DEBUG) { 186 if (debug >= DEBUG) {
175 if (got_response) { 187 if (got_response) {
176 printk(KERN_DEBUG PFX "time to process command was: %d ms\n", 188 printk(KERN_DEBUG PFX
189 "time to process command was: %d ms\n",
177 count); 190 count);
178 } else { 191 } else {
179 printk(KERN_DEBUG PFX "card did not respond on command!\n"); 192 printk(KERN_DEBUG PFX
193 "card did not respond on command!\n");
180 } 194 }
181 } 195 }
182 196
@@ -189,7 +203,8 @@ static int send_command(int cmd, int *msb, int *lsb)
189 inb_p(pcipcwd_private.io_addr + 6); 203 inb_p(pcipcwd_private.io_addr + 6);
190 204
191 if (debug >= DEBUG) 205 if (debug >= DEBUG)
192 printk(KERN_DEBUG PFX "received following data for cmd=0x%02x: msb=0x%02x lsb=0x%02x\n", 206 printk(KERN_DEBUG PFX "received following data for "
207 "cmd=0x%02x: msb=0x%02x lsb=0x%02x\n",
193 cmd, *msb, *lsb); 208 cmd, *msb, *lsb);
194 } 209 }
195 210
@@ -218,7 +233,8 @@ static void pcipcwd_show_card_info(void)
218 char fw_ver_str[20]; /* The cards firmware version */ 233 char fw_ver_str[20]; /* The cards firmware version */
219 int option_switches; 234 int option_switches;
220 235
221 got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); 236 got_fw_rev = send_command(CMD_GET_FIRMWARE_VERSION, &fw_rev_major,
237 &fw_rev_minor);
222 if (got_fw_rev) 238 if (got_fw_rev)
223 sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); 239 sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
224 else 240 else
@@ -227,23 +243,27 @@ static void pcipcwd_show_card_info(void)
227 /* Get switch settings */ 243 /* Get switch settings */
228 option_switches = pcipcwd_get_option_switches(); 244 option_switches = pcipcwd_get_option_switches();
229 245
230 printk(KERN_INFO PFX "Found card at port 0x%04x (Firmware: %s) %s temp option\n", 246 printk(KERN_INFO PFX "Found card at port "
247 "0x%04x (Firmware: %s) %s temp option\n",
231 (int) pcipcwd_private.io_addr, fw_ver_str, 248 (int) pcipcwd_private.io_addr, fw_ver_str,
232 (pcipcwd_private.supports_temp ? "with" : "without")); 249 (pcipcwd_private.supports_temp ? "with" : "without"));
233 250
234 printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", 251 printk(KERN_INFO PFX "Option switches (0x%02x): "
252 "Temperature Reset Enable=%s, Power On Delay=%s\n",
235 option_switches, 253 option_switches,
236 ((option_switches & 0x10) ? "ON" : "OFF"), 254 ((option_switches & 0x10) ? "ON" : "OFF"),
237 ((option_switches & 0x08) ? "ON" : "OFF")); 255 ((option_switches & 0x08) ? "ON" : "OFF"));
238 256
239 if (pcipcwd_private.boot_status & WDIOF_CARDRESET) 257 if (pcipcwd_private.boot_status & WDIOF_CARDRESET)
240 printk(KERN_INFO PFX "Previous reset was caused by the Watchdog card\n"); 258 printk(KERN_INFO PFX
259 "Previous reset was caused by the Watchdog card\n");
241 260
242 if (pcipcwd_private.boot_status & WDIOF_OVERHEAT) 261 if (pcipcwd_private.boot_status & WDIOF_OVERHEAT)
243 printk(KERN_INFO PFX "Card sensed a CPU Overheat\n"); 262 printk(KERN_INFO PFX "Card sensed a CPU Overheat\n");
244 263
245 if (pcipcwd_private.boot_status == 0) 264 if (pcipcwd_private.boot_status == 0)
246 printk(KERN_INFO PFX "No previous trip detected - Cold boot or reset\n"); 265 printk(KERN_INFO PFX
266 "No previous trip detected - Cold boot or reset\n");
247} 267}
248 268
249static int pcipcwd_start(void) 269static int pcipcwd_start(void)
@@ -283,7 +303,8 @@ static int pcipcwd_stop(void)
283 spin_unlock(&pcipcwd_private.io_lock); 303 spin_unlock(&pcipcwd_private.io_lock);
284 304
285 if (!(stat_reg & WD_PCI_WDIS)) { 305 if (!(stat_reg & WD_PCI_WDIS)) {
286 printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n"); 306 printk(KERN_ERR PFX
307 "Card did not acknowledge disable attempt\n");
287 return -1; 308 return -1;
288 } 309 }
289 310
@@ -364,7 +385,8 @@ static int pcipcwd_clear_status(void)
364 } 385 }
365 386
366 /* clear trip status & LED and keep mode of relay 2 */ 387 /* clear trip status & LED and keep mode of relay 2 */
367 outb_p((control_status & WD_PCI_R2DS) | WD_PCI_WTRP, pcipcwd_private.io_addr + 1); 388 outb_p((control_status & WD_PCI_R2DS) | WD_PCI_WTRP,
389 pcipcwd_private.io_addr + 1);
368 390
369 /* clear reset counter */ 391 /* clear reset counter */
370 msb = 0; 392 msb = 0;
@@ -437,7 +459,8 @@ static ssize_t pcipcwd_write(struct file *file, const char __user *data,
437 * five months ago... */ 459 * five months ago... */
438 expect_release = 0; 460 expect_release = 0;
439 461
440 /* scan to see whether or not we got the magic character */ 462 /* scan to see whether or not we got the
463 * magic character */
441 for (i = 0; i != len; i++) { 464 for (i = 0; i != len; i++) {
442 char c; 465 char c;
443 if (get_user(c, data + i)) 466 if (get_user(c, data + i))
@@ -531,7 +554,7 @@ static long pcipcwd_ioctl(struct file *file, unsigned int cmd,
531 return -EFAULT; 554 return -EFAULT;
532 555
533 if (pcipcwd_set_heartbeat(new_heartbeat)) 556 if (pcipcwd_set_heartbeat(new_heartbeat))
534 return -EINVAL; 557 return -EINVAL;
535 558
536 pcipcwd_keepalive(); 559 pcipcwd_keepalive();
537 /* Fall */ 560 /* Fall */
@@ -560,7 +583,8 @@ static int pcipcwd_open(struct inode *inode, struct file *file)
560 /* /dev/watchdog can only be opened once */ 583 /* /dev/watchdog can only be opened once */
561 if (test_and_set_bit(0, &is_active)) { 584 if (test_and_set_bit(0, &is_active)) {
562 if (debug >= VERBOSE) 585 if (debug >= VERBOSE)
563 printk(KERN_ERR PFX "Attempt to open already opened device.\n"); 586 printk(KERN_ERR PFX
587 "Attempt to open already opened device.\n");
564 return -EBUSY; 588 return -EBUSY;
565 } 589 }
566 590
@@ -578,7 +602,8 @@ static int pcipcwd_release(struct inode *inode, struct file *file)
578 if (expect_release == 42) { 602 if (expect_release == 42) {
579 pcipcwd_stop(); 603 pcipcwd_stop();
580 } else { 604 } else {
581 printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); 605 printk(KERN_CRIT PFX
606 "Unexpected close, not stopping watchdog!\n");
582 pcipcwd_keepalive(); 607 pcipcwd_keepalive();
583 } 608 }
584 expect_release = 0; 609 expect_release = 0;
@@ -621,7 +646,8 @@ static int pcipcwd_temp_release(struct inode *inode, struct file *file)
621 * Notify system 646 * Notify system
622 */ 647 */
623 648
624static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused) 649static int pcipcwd_notify_sys(struct notifier_block *this, unsigned long code,
650 void *unused)
625{ 651{
626 if (code == SYS_DOWN || code == SYS_HALT) 652 if (code == SYS_DOWN || code == SYS_HALT)
627 pcipcwd_stop(); /* Turn the WDT off */ 653 pcipcwd_stop(); /* Turn the WDT off */
@@ -722,34 +748,38 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev,
722 748
723 /* If heartbeat = 0 then we use the heartbeat from the dip-switches */ 749 /* If heartbeat = 0 then we use the heartbeat from the dip-switches */
724 if (heartbeat == 0) 750 if (heartbeat == 0)
725 heartbeat = heartbeat_tbl[(pcipcwd_get_option_switches() & 0x07)]; 751 heartbeat =
752 heartbeat_tbl[(pcipcwd_get_option_switches() & 0x07)];
726 753
727 /* Check that the heartbeat value is within it's range ; if not reset to the default */ 754 /* Check that the heartbeat value is within it's range ;
755 * if not reset to the default */
728 if (pcipcwd_set_heartbeat(heartbeat)) { 756 if (pcipcwd_set_heartbeat(heartbeat)) {
729 pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT); 757 pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT);
730 printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n", 758 printk(KERN_INFO PFX
759 "heartbeat value must be 0<heartbeat<65536, using %d\n",
731 WATCHDOG_HEARTBEAT); 760 WATCHDOG_HEARTBEAT);
732 } 761 }
733 762
734 ret = register_reboot_notifier(&pcipcwd_notifier); 763 ret = register_reboot_notifier(&pcipcwd_notifier);
735 if (ret != 0) { 764 if (ret != 0) {
736 printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", 765 printk(KERN_ERR PFX
737 ret); 766 "cannot register reboot notifier (err=%d)\n", ret);
738 goto err_out_release_region; 767 goto err_out_release_region;
739 } 768 }
740 769
741 if (pcipcwd_private.supports_temp) { 770 if (pcipcwd_private.supports_temp) {
742 ret = misc_register(&pcipcwd_temp_miscdev); 771 ret = misc_register(&pcipcwd_temp_miscdev);
743 if (ret != 0) { 772 if (ret != 0) {
744 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 773 printk(KERN_ERR PFX "cannot register miscdev on "
745 TEMP_MINOR, ret); 774 "minor=%d (err=%d)\n", TEMP_MINOR, ret);
746 goto err_out_unregister_reboot; 775 goto err_out_unregister_reboot;
747 } 776 }
748 } 777 }
749 778
750 ret = misc_register(&pcipcwd_miscdev); 779 ret = misc_register(&pcipcwd_miscdev);
751 if (ret != 0) { 780 if (ret != 0) {
752 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 781 printk(KERN_ERR PFX
782 "cannot register miscdev on minor=%d (err=%d)\n",
753 WATCHDOG_MINOR, ret); 783 WATCHDOG_MINOR, ret);
754 goto err_out_misc_deregister; 784 goto err_out_misc_deregister;
755 } 785 }
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
index b5320a8e7451..052fe451851f 100644
--- a/drivers/watchdog/pcwd_usb.c
+++ b/drivers/watchdog/pcwd_usb.c
@@ -51,12 +51,11 @@
51 51
52/* Use our own dbg macro */ 52/* Use our own dbg macro */
53#undef dbg 53#undef dbg
54#define dbg(format, arg...) do { if (debug) printk(KERN_DEBUG PFX format "\n" , ## arg); } while (0) 54#define dbg(format, arg...) \
55 55 do { if (debug) printk(KERN_DEBUG PFX format "\n" , ## arg); } while (0)
56 56
57/* Module and Version Information */ 57/* Module and Version Information */
58#define DRIVER_VERSION "1.02" 58#define DRIVER_VERSION "1.02"
59#define DRIVER_DATE "21 Jan 2007"
60#define DRIVER_AUTHOR "Wim Van Sebroeck <wim@iguana.be>" 59#define DRIVER_AUTHOR "Wim Van Sebroeck <wim@iguana.be>"
61#define DRIVER_DESC "Berkshire USB-PC Watchdog driver" 60#define DRIVER_DESC "Berkshire USB-PC Watchdog driver"
62#define DRIVER_LICENSE "GPL" 61#define DRIVER_LICENSE "GPL"
@@ -73,14 +72,18 @@ MODULE_ALIAS_MISCDEV(TEMP_MINOR);
73module_param(debug, int, 0); 72module_param(debug, int, 0);
74MODULE_PARM_DESC(debug, "Debug enabled or not"); 73MODULE_PARM_DESC(debug, "Debug enabled or not");
75 74
76#define WATCHDOG_HEARTBEAT 0 /* default heartbeat = delay-time from dip-switches */ 75#define WATCHDOG_HEARTBEAT 0 /* default heartbeat =
76 delay-time from dip-switches */
77static int heartbeat = WATCHDOG_HEARTBEAT; 77static int heartbeat = WATCHDOG_HEARTBEAT;
78module_param(heartbeat, int, 0); 78module_param(heartbeat, int, 0);
79MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. (0<heartbeat<65536 or 0=delay-time from dip-switches, default=" __MODULE_STRING(WATCHDOG_HEARTBEAT) ")"); 79MODULE_PARM_DESC(heartbeat, "Watchdog heartbeat in seconds. "
80 "(0<heartbeat<65536 or 0=delay-time from dip-switches, default="
81 __MODULE_STRING(WATCHDOG_HEARTBEAT) ")");
80 82
81static int nowayout = WATCHDOG_NOWAYOUT; 83static int nowayout = WATCHDOG_NOWAYOUT;
82module_param(nowayout, int, 0); 84module_param(nowayout, int, 0);
83MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 85MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
86 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
84 87
85/* The vendor and product id's for the USB-PC Watchdog card */ 88/* The vendor and product id's for the USB-PC Watchdog card */
86#define USB_PCWD_VENDOR_ID 0x0c98 89#define USB_PCWD_VENDOR_ID 0x0c98
@@ -91,20 +94,21 @@ static struct usb_device_id usb_pcwd_table[] = {
91 { USB_DEVICE(USB_PCWD_VENDOR_ID, USB_PCWD_PRODUCT_ID) }, 94 { USB_DEVICE(USB_PCWD_VENDOR_ID, USB_PCWD_PRODUCT_ID) },
92 { } /* Terminating entry */ 95 { } /* Terminating entry */
93}; 96};
94MODULE_DEVICE_TABLE (usb, usb_pcwd_table); 97MODULE_DEVICE_TABLE(usb, usb_pcwd_table);
95 98
96/* according to documentation max. time to process a command for the USB 99/* according to documentation max. time to process a command for the USB
97 * watchdog card is 100 or 200 ms, so we give it 250 ms to do it's job */ 100 * watchdog card is 100 or 200 ms, so we give it 250 ms to do it's job */
98#define USB_COMMAND_TIMEOUT 250 101#define USB_COMMAND_TIMEOUT 250
99 102
100/* Watchdog's internal commands */ 103/* Watchdog's internal commands */
101#define CMD_READ_TEMP 0x02 /* Read Temperature; Re-trigger Watchdog */ 104#define CMD_READ_TEMP 0x02 /* Read Temperature;
105 Re-trigger Watchdog */
102#define CMD_TRIGGER CMD_READ_TEMP 106#define CMD_TRIGGER CMD_READ_TEMP
103#define CMD_GET_STATUS 0x04 /* Get Status Information */ 107#define CMD_GET_STATUS 0x04 /* Get Status Information */
104#define CMD_GET_FIRMWARE_VERSION 0x08 /* Get Firmware Version */ 108#define CMD_GET_FIRMWARE_VERSION 0x08 /* Get Firmware Version */
105#define CMD_GET_DIP_SWITCH_SETTINGS 0x0c /* Get Dip Switch Settings */ 109#define CMD_GET_DIP_SWITCH_SETTINGS 0x0c /* Get Dip Switch Settings */
106#define CMD_READ_WATCHDOG_TIMEOUT 0x18 /* Read Current Watchdog Time */ 110#define CMD_READ_WATCHDOG_TIMEOUT 0x18 /* Read Current Watchdog Time */
107#define CMD_WRITE_WATCHDOG_TIMEOUT 0x19 /* Write Current Watchdog Time */ 111#define CMD_WRITE_WATCHDOG_TIMEOUT 0x19 /* Write Current WatchdogTime */
108#define CMD_ENABLE_WATCHDOG 0x30 /* Enable / Disable Watchdog */ 112#define CMD_ENABLE_WATCHDOG 0x30 /* Enable / Disable Watchdog */
109#define CMD_DISABLE_WATCHDOG CMD_ENABLE_WATCHDOG 113#define CMD_DISABLE_WATCHDOG CMD_ENABLE_WATCHDOG
110 114
@@ -129,23 +133,36 @@ static char expect_release;
129 133
130/* Structure to hold all of our device specific stuff */ 134/* Structure to hold all of our device specific stuff */
131struct usb_pcwd_private { 135struct usb_pcwd_private {
132 struct usb_device *udev; /* save off the usb device pointer */ 136 /* save off the usb device pointer */
133 struct usb_interface *interface; /* the interface for this device */ 137 struct usb_device *udev;
134 138 /* the interface for this device */
135 unsigned int interface_number; /* the interface number used for cmd's */ 139 struct usb_interface *interface;
136 140
137 unsigned char *intr_buffer; /* the buffer to intr data */ 141 /* the interface number used for cmd's */
138 dma_addr_t intr_dma; /* the dma address for the intr buffer */ 142 unsigned int interface_number;
139 size_t intr_size; /* the size of the intr buffer */ 143
140 struct urb *intr_urb; /* the urb used for the intr pipe */ 144 /* the buffer to intr data */
141 145 unsigned char *intr_buffer;
142 unsigned char cmd_command; /* The command that is reported back */ 146 /* the dma address for the intr buffer */
143 unsigned char cmd_data_msb; /* The data MSB that is reported back */ 147 dma_addr_t intr_dma;
144 unsigned char cmd_data_lsb; /* The data LSB that is reported back */ 148 /* the size of the intr buffer */
145 atomic_t cmd_received; /* true if we received a report after a command */ 149 size_t intr_size;
146 150 /* the urb used for the intr pipe */
147 int exists; /* Wether or not the device exists */ 151 struct urb *intr_urb;
148 struct mutex mtx; /* locks this structure */ 152
153 /* The command that is reported back */
154 unsigned char cmd_command;
155 /* The data MSB that is reported back */
156 unsigned char cmd_data_msb;
157 /* The data LSB that is reported back */
158 unsigned char cmd_data_lsb;
159 /* true if we received a report after a command */
160 atomic_t cmd_received;
161
162 /* Wether or not the device exists */
163 int exists;
164 /* locks this structure */
165 struct mutex mtx;
149}; 166};
150static struct usb_pcwd_private *usb_pcwd_device; 167static struct usb_pcwd_private *usb_pcwd_device;
151 168
@@ -153,7 +170,8 @@ static struct usb_pcwd_private *usb_pcwd_device;
153static DEFINE_MUTEX(disconnect_mutex); 170static DEFINE_MUTEX(disconnect_mutex);
154 171
155/* local function prototypes */ 172/* local function prototypes */
156static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_device_id *id); 173static int usb_pcwd_probe(struct usb_interface *interface,
174 const struct usb_device_id *id);
157static void usb_pcwd_disconnect(struct usb_interface *interface); 175static void usb_pcwd_disconnect(struct usb_interface *interface);
158 176
159/* usb specific object needed to register this driver with the usb subsystem */ 177/* usb specific object needed to register this driver with the usb subsystem */
@@ -167,7 +185,8 @@ static struct usb_driver usb_pcwd_driver = {
167 185
168static void usb_pcwd_intr_done(struct urb *urb) 186static void usb_pcwd_intr_done(struct urb *urb)
169{ 187{
170 struct usb_pcwd_private *usb_pcwd = (struct usb_pcwd_private *)urb->context; 188 struct usb_pcwd_private *usb_pcwd =
189 (struct usb_pcwd_private *)urb->context;
171 unsigned char *data = usb_pcwd->intr_buffer; 190 unsigned char *data = usb_pcwd->intr_buffer;
172 int retval; 191 int retval;
173 192
@@ -178,11 +197,13 @@ static void usb_pcwd_intr_done(struct urb *urb)
178 case -ENOENT: 197 case -ENOENT:
179 case -ESHUTDOWN: 198 case -ESHUTDOWN:
180 /* this urb is terminated, clean up */ 199 /* this urb is terminated, clean up */
181 dbg("%s - urb shutting down with status: %d", __func__, urb->status); 200 dbg("%s - urb shutting down with status: %d", __func__,
201 urb->status);
182 return; 202 return;
183 /* -EPIPE: should clear the halt */ 203 /* -EPIPE: should clear the halt */
184 default: /* error */ 204 default: /* error */
185 dbg("%s - nonzero urb status received: %d", __func__, urb->status); 205 dbg("%s - nonzero urb status received: %d", __func__,
206 urb->status);
186 goto resubmit; 207 goto resubmit;
187 } 208 }
188 209
@@ -199,22 +220,23 @@ static void usb_pcwd_intr_done(struct urb *urb)
199resubmit: 220resubmit:
200 retval = usb_submit_urb(urb, GFP_ATOMIC); 221 retval = usb_submit_urb(urb, GFP_ATOMIC);
201 if (retval) 222 if (retval)
202 printk(KERN_ERR PFX "can't resubmit intr, usb_submit_urb failed with result %d\n", 223 printk(KERN_ERR PFX "can't resubmit intr, "
203 retval); 224 "usb_submit_urb failed with result %d\n", retval);
204} 225}
205 226
206static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, unsigned char cmd, 227static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd,
207 unsigned char *msb, unsigned char *lsb) 228 unsigned char cmd, unsigned char *msb, unsigned char *lsb)
208{ 229{
209 int got_response, count; 230 int got_response, count;
210 unsigned char buf[6]; 231 unsigned char buf[6];
211 232
212 /* We will not send any commands if the USB PCWD device does not exist */ 233 /* We will not send any commands if the USB PCWD device does
234 * not exist */
213 if ((!usb_pcwd) || (!usb_pcwd->exists)) 235 if ((!usb_pcwd) || (!usb_pcwd->exists))
214 return -1; 236 return -1;
215 237
216 /* The USB PC Watchdog uses a 6 byte report format. The board currently uses 238 /* The USB PC Watchdog uses a 6 byte report format.
217 * only 3 of the six bytes of the report. */ 239 * The board currently uses only 3 of the six bytes of the report. */
218 buf[0] = cmd; /* Byte 0 = CMD */ 240 buf[0] = cmd; /* Byte 0 = CMD */
219 buf[1] = *msb; /* Byte 1 = Data MSB */ 241 buf[1] = *msb; /* Byte 1 = Data MSB */
220 buf[2] = *lsb; /* Byte 2 = Data LSB */ 242 buf[2] = *lsb; /* Byte 2 = Data LSB */
@@ -229,12 +251,14 @@ static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, unsigned cha
229 HID_REQ_SET_REPORT, HID_DT_REPORT, 251 HID_REQ_SET_REPORT, HID_DT_REPORT,
230 0x0200, usb_pcwd->interface_number, buf, sizeof(buf), 252 0x0200, usb_pcwd->interface_number, buf, sizeof(buf),
231 USB_COMMAND_TIMEOUT) != sizeof(buf)) { 253 USB_COMMAND_TIMEOUT) != sizeof(buf)) {
232 dbg("usb_pcwd_send_command: error in usb_control_msg for cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb); 254 dbg("usb_pcwd_send_command: error in usb_control_msg for "
255 "cmd 0x%x 0x%x 0x%x\n", cmd, *msb, *lsb);
233 } 256 }
234 /* wait till the usb card processed the command, 257 /* wait till the usb card processed the command,
235 * with a max. timeout of USB_COMMAND_TIMEOUT */ 258 * with a max. timeout of USB_COMMAND_TIMEOUT */
236 got_response = 0; 259 got_response = 0;
237 for (count = 0; (count < USB_COMMAND_TIMEOUT) && (!got_response); count++) { 260 for (count = 0; (count < USB_COMMAND_TIMEOUT) && (!got_response);
261 count++) {
238 mdelay(1); 262 mdelay(1);
239 if (atomic_read(&usb_pcwd->cmd_received)) 263 if (atomic_read(&usb_pcwd->cmd_received))
240 got_response = 1; 264 got_response = 1;
@@ -256,10 +280,12 @@ static int usb_pcwd_start(struct usb_pcwd_private *usb_pcwd)
256 int retval; 280 int retval;
257 281
258 /* Enable Watchdog */ 282 /* Enable Watchdog */
259 retval = usb_pcwd_send_command(usb_pcwd, CMD_ENABLE_WATCHDOG, &msb, &lsb); 283 retval = usb_pcwd_send_command(usb_pcwd, CMD_ENABLE_WATCHDOG,
284 &msb, &lsb);
260 285
261 if ((retval == 0) || (lsb == 0)) { 286 if ((retval == 0) || (lsb == 0)) {
262 printk(KERN_ERR PFX "Card did not acknowledge enable attempt\n"); 287 printk(KERN_ERR PFX
288 "Card did not acknowledge enable attempt\n");
263 return -1; 289 return -1;
264 } 290 }
265 291
@@ -273,10 +299,12 @@ static int usb_pcwd_stop(struct usb_pcwd_private *usb_pcwd)
273 int retval; 299 int retval;
274 300
275 /* Disable Watchdog */ 301 /* Disable Watchdog */
276 retval = usb_pcwd_send_command(usb_pcwd, CMD_DISABLE_WATCHDOG, &msb, &lsb); 302 retval = usb_pcwd_send_command(usb_pcwd, CMD_DISABLE_WATCHDOG,
303 &msb, &lsb);
277 304
278 if ((retval == 0) || (lsb != 0)) { 305 if ((retval == 0) || (lsb != 0)) {
279 printk(KERN_ERR PFX "Card did not acknowledge disable attempt\n"); 306 printk(KERN_ERR PFX
307 "Card did not acknowledge disable attempt\n");
280 return -1; 308 return -1;
281 } 309 }
282 310
@@ -308,7 +336,8 @@ static int usb_pcwd_set_heartbeat(struct usb_pcwd_private *usb_pcwd, int t)
308 return 0; 336 return 0;
309} 337}
310 338
311static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, int *temperature) 339static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd,
340 int *temperature)
312{ 341{
313 unsigned char msb, lsb; 342 unsigned char msb, lsb;
314 343
@@ -323,7 +352,8 @@ static int usb_pcwd_get_temperature(struct usb_pcwd_private *usb_pcwd, int *temp
323 return 0; 352 return 0;
324} 353}
325 354
326static int usb_pcwd_get_timeleft(struct usb_pcwd_private *usb_pcwd, int *time_left) 355static int usb_pcwd_get_timeleft(struct usb_pcwd_private *usb_pcwd,
356 int *time_left)
327{ 357{
328 unsigned char msb, lsb; 358 unsigned char msb, lsb;
329 359
@@ -341,7 +371,7 @@ static int usb_pcwd_get_timeleft(struct usb_pcwd_private *usb_pcwd, int *time_le
341 */ 371 */
342 372
343static ssize_t usb_pcwd_write(struct file *file, const char __user *data, 373static ssize_t usb_pcwd_write(struct file *file, const char __user *data,
344 size_t len, loff_t *ppos) 374 size_t len, loff_t *ppos)
345{ 375{
346 /* See if we got the magic character 'V' and reload the timer */ 376 /* See if we got the magic character 'V' and reload the timer */
347 if (len) { 377 if (len) {
@@ -352,7 +382,8 @@ static ssize_t usb_pcwd_write(struct file *file, const char __user *data,
352 * five months ago... */ 382 * five months ago... */
353 expect_release = 0; 383 expect_release = 0;
354 384
355 /* scan to see whether or not we got the magic character */ 385 /* scan to see whether or not we got the
386 * magic character */
356 for (i = 0; i != len; i++) { 387 for (i = 0; i != len; i++) {
357 char c; 388 char c;
358 if (get_user(c, data + i)) 389 if (get_user(c, data + i))
@@ -431,7 +462,7 @@ static long usb_pcwd_ioctl(struct file *file, unsigned int cmd,
431 return -EFAULT; 462 return -EFAULT;
432 463
433 if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat)) 464 if (usb_pcwd_set_heartbeat(usb_pcwd_device, new_heartbeat))
434 return -EINVAL; 465 return -EINVAL;
435 466
436 usb_pcwd_keepalive(usb_pcwd_device); 467 usb_pcwd_keepalive(usb_pcwd_device);
437 /* Fall */ 468 /* Fall */
@@ -475,7 +506,8 @@ static int usb_pcwd_release(struct inode *inode, struct file *file)
475 if (expect_release == 42) { 506 if (expect_release == 42) {
476 usb_pcwd_stop(usb_pcwd_device); 507 usb_pcwd_stop(usb_pcwd_device);
477 } else { 508 } else {
478 printk(KERN_CRIT PFX "Unexpected close, not stopping watchdog!\n"); 509 printk(KERN_CRIT PFX
510 "Unexpected close, not stopping watchdog!\n");
479 usb_pcwd_keepalive(usb_pcwd_device); 511 usb_pcwd_keepalive(usb_pcwd_device);
480 } 512 }
481 expect_release = 0; 513 expect_release = 0;
@@ -515,7 +547,8 @@ static int usb_pcwd_temperature_release(struct inode *inode, struct file *file)
515 * Notify system 547 * Notify system
516 */ 548 */
517 549
518static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code, void *unused) 550static int usb_pcwd_notify_sys(struct notifier_block *this, unsigned long code,
551 void *unused)
519{ 552{
520 if (code == SYS_DOWN || code == SYS_HALT) 553 if (code == SYS_DOWN || code == SYS_HALT)
521 usb_pcwd_stop(usb_pcwd_device); /* Turn the WDT off */ 554 usb_pcwd_stop(usb_pcwd_device); /* Turn the WDT off */
@@ -578,7 +611,8 @@ static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
578 * Called by the usb core when a new device is connected that it thinks 611 * Called by the usb core when a new device is connected that it thinks
579 * this driver might be interested in. 612 * this driver might be interested in.
580 */ 613 */
581static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_device_id *id) 614static int usb_pcwd_probe(struct usb_interface *interface,
615 const struct usb_device_id *id)
582{ 616{
583 struct usb_device *udev = interface_to_usbdev(interface); 617 struct usb_device *udev = interface_to_usbdev(interface);
584 struct usb_host_interface *iface_desc; 618 struct usb_host_interface *iface_desc;
@@ -602,7 +636,8 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
602 636
603 /* check out that we have a HID device */ 637 /* check out that we have a HID device */
604 if (!(iface_desc->desc.bInterfaceClass == USB_CLASS_HID)) { 638 if (!(iface_desc->desc.bInterfaceClass == USB_CLASS_HID)) {
605 printk(KERN_ERR PFX "The device isn't a Human Interface Device\n"); 639 printk(KERN_ERR PFX
640 "The device isn't a Human Interface Device\n");
606 return -ENODEV; 641 return -ENODEV;
607 } 642 }
608 643
@@ -632,10 +667,12 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
632 usb_pcwd->udev = udev; 667 usb_pcwd->udev = udev;
633 usb_pcwd->interface = interface; 668 usb_pcwd->interface = interface;
634 usb_pcwd->interface_number = iface_desc->desc.bInterfaceNumber; 669 usb_pcwd->interface_number = iface_desc->desc.bInterfaceNumber;
635 usb_pcwd->intr_size = (le16_to_cpu(endpoint->wMaxPacketSize) > 8 ? le16_to_cpu(endpoint->wMaxPacketSize) : 8); 670 usb_pcwd->intr_size = (le16_to_cpu(endpoint->wMaxPacketSize) > 8 ?
671 le16_to_cpu(endpoint->wMaxPacketSize) : 8);
636 672
637 /* set up the memory buffer's */ 673 /* set up the memory buffer's */
638 usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size, GFP_ATOMIC, &usb_pcwd->intr_dma); 674 usb_pcwd->intr_buffer = usb_buffer_alloc(udev, usb_pcwd->intr_size,
675 GFP_ATOMIC, &usb_pcwd->intr_dma);
639 if (!usb_pcwd->intr_buffer) { 676 if (!usb_pcwd->intr_buffer) {
640 printk(KERN_ERR PFX "Out of memory\n"); 677 printk(KERN_ERR PFX "Out of memory\n");
641 goto error; 678 goto error;
@@ -669,7 +706,8 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
669 usb_pcwd_stop(usb_pcwd); 706 usb_pcwd_stop(usb_pcwd);
670 707
671 /* Get the Firmware Version */ 708 /* Get the Firmware Version */
672 got_fw_rev = usb_pcwd_send_command(usb_pcwd, CMD_GET_FIRMWARE_VERSION, &fw_rev_major, &fw_rev_minor); 709 got_fw_rev = usb_pcwd_send_command(usb_pcwd, CMD_GET_FIRMWARE_VERSION,
710 &fw_rev_major, &fw_rev_minor);
673 if (got_fw_rev) 711 if (got_fw_rev)
674 sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor); 712 sprintf(fw_ver_str, "%u.%02u", fw_rev_major, fw_rev_minor);
675 else 713 else
@@ -679,9 +717,11 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
679 fw_ver_str); 717 fw_ver_str);
680 718
681 /* Get switch settings */ 719 /* Get switch settings */
682 usb_pcwd_send_command(usb_pcwd, CMD_GET_DIP_SWITCH_SETTINGS, &dummy, &option_switches); 720 usb_pcwd_send_command(usb_pcwd, CMD_GET_DIP_SWITCH_SETTINGS, &dummy,
721 &option_switches);
683 722
684 printk(KERN_INFO PFX "Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", 723 printk(KERN_INFO PFX "Option switches (0x%02x): "
724 "Temperature Reset Enable=%s, Power On Delay=%s\n",
685 option_switches, 725 option_switches,
686 ((option_switches & 0x10) ? "ON" : "OFF"), 726 ((option_switches & 0x10) ? "ON" : "OFF"),
687 ((option_switches & 0x08) ? "ON" : "OFF")); 727 ((option_switches & 0x08) ? "ON" : "OFF"));
@@ -690,30 +730,35 @@ static int usb_pcwd_probe(struct usb_interface *interface, const struct usb_devi
690 if (heartbeat == 0) 730 if (heartbeat == 0)
691 heartbeat = heartbeat_tbl[(option_switches & 0x07)]; 731 heartbeat = heartbeat_tbl[(option_switches & 0x07)];
692 732
693 /* Check that the heartbeat value is within it's range ; if not reset to the default */ 733 /* Check that the heartbeat value is within it's range ;
734 * if not reset to the default */
694 if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) { 735 if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) {
695 usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT); 736 usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT);
696 printk(KERN_INFO PFX "heartbeat value must be 0<heartbeat<65536, using %d\n", 737 printk(KERN_INFO PFX
738 "heartbeat value must be 0<heartbeat<65536, using %d\n",
697 WATCHDOG_HEARTBEAT); 739 WATCHDOG_HEARTBEAT);
698 } 740 }
699 741
700 retval = register_reboot_notifier(&usb_pcwd_notifier); 742 retval = register_reboot_notifier(&usb_pcwd_notifier);
701 if (retval != 0) { 743 if (retval != 0) {
702 printk(KERN_ERR PFX "cannot register reboot notifier (err=%d)\n", 744 printk(KERN_ERR PFX
745 "cannot register reboot notifier (err=%d)\n",
703 retval); 746 retval);
704 goto error; 747 goto error;
705 } 748 }
706 749
707 retval = misc_register(&usb_pcwd_temperature_miscdev); 750 retval = misc_register(&usb_pcwd_temperature_miscdev);
708 if (retval != 0) { 751 if (retval != 0) {
709 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 752 printk(KERN_ERR PFX
753 "cannot register miscdev on minor=%d (err=%d)\n",
710 TEMP_MINOR, retval); 754 TEMP_MINOR, retval);
711 goto err_out_unregister_reboot; 755 goto err_out_unregister_reboot;
712 } 756 }
713 757
714 retval = misc_register(&usb_pcwd_miscdev); 758 retval = misc_register(&usb_pcwd_miscdev);
715 if (retval != 0) { 759 if (retval != 0) {
716 printk(KERN_ERR PFX "cannot register miscdev on minor=%d (err=%d)\n", 760 printk(KERN_ERR PFX
761 "cannot register miscdev on minor=%d (err=%d)\n",
717 WATCHDOG_MINOR, retval); 762 WATCHDOG_MINOR, retval);
718 goto err_out_misc_deregister; 763 goto err_out_misc_deregister;
719 } 764 }
@@ -799,7 +844,7 @@ static int __init usb_pcwd_init(void)
799 return result; 844 return result;
800 } 845 }
801 846
802 printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION " (" DRIVER_DATE ")\n"); 847 printk(KERN_INFO PFX DRIVER_DESC " v" DRIVER_VERSION "\n");
803 return 0; 848 return 0;
804} 849}
805 850
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c
index 6d9f3d4a9987..64135195f827 100644
--- a/drivers/watchdog/pnx4008_wdt.c
+++ b/drivers/watchdog/pnx4008_wdt.c
@@ -54,22 +54,22 @@
54 54
55/* WDTIM_CTRL bit definitions */ 55/* WDTIM_CTRL bit definitions */
56#define COUNT_ENAB 1 56#define COUNT_ENAB 1
57#define RESET_COUNT (1<<1) 57#define RESET_COUNT (1 << 1)
58#define DEBUG_EN (1<<2) 58#define DEBUG_EN (1 << 2)
59 59
60/* WDTIM_MCTRL bit definitions */ 60/* WDTIM_MCTRL bit definitions */
61#define MR0_INT 1 61#define MR0_INT 1
62#undef RESET_COUNT0 62#undef RESET_COUNT0
63#define RESET_COUNT0 (1<<2) 63#define RESET_COUNT0 (1 << 2)
64#define STOP_COUNT0 (1<<2) 64#define STOP_COUNT0 (1 << 2)
65#define M_RES1 (1<<3) 65#define M_RES1 (1 << 3)
66#define M_RES2 (1<<4) 66#define M_RES2 (1 << 4)
67#define RESFRC1 (1<<5) 67#define RESFRC1 (1 << 5)
68#define RESFRC2 (1<<6) 68#define RESFRC2 (1 << 6)
69 69
70/* WDTIM_EMR bit definitions */ 70/* WDTIM_EMR bit definitions */
71#define EXT_MATCH0 1 71#define EXT_MATCH0 1
72#define MATCH_OUTPUT_HIGH (2<<4) /*a MATCH_CTRL setting */ 72#define MATCH_OUTPUT_HIGH (2 << 4) /*a MATCH_CTRL setting */
73 73
74/* WDTIM_RES bit definitions */ 74/* WDTIM_RES bit definitions */
75#define WDOG_RESET 1 /* read only */ 75#define WDOG_RESET 1 /* read only */
diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c
index 01cc7e39d92f..2cff53310f7b 100644
--- a/drivers/watchdog/riowd.c
+++ b/drivers/watchdog/riowd.c
@@ -146,7 +146,8 @@ static long riowd_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
146 return 0; 146 return 0;
147} 147}
148 148
149static ssize_t riowd_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos) 149static ssize_t riowd_write(struct file *file, const char __user *buf,
150 size_t count, loff_t *ppos)
150{ 151{
151 struct riowd *p = riowd_device; 152 struct riowd *p = riowd_device;
152 153
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c
index e19b45794717..5bd782f27837 100644
--- a/drivers/watchdog/sa1100_wdt.c
+++ b/drivers/watchdog/sa1100_wdt.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * Watchdog driver for the SA11x0/PXA2xx 2 * Watchdog driver for the SA11x0/PXA2xx
3 * 3 *
4 * (c) Copyright 2000 Oleg Drokin <green@crimea.edu> 4 * (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
5 * Based on SoftDog driver by Alan Cox <alan@lxorguk.ukuu.org.uk> 5 * Based on SoftDog driver by Alan Cox <alan@lxorguk.ukuu.org.uk>
6 * 6 *
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
@@ -15,7 +15,7 @@
15 * 15 *
16 * (c) Copyright 2000 Oleg Drokin <green@crimea.edu> 16 * (c) Copyright 2000 Oleg Drokin <green@crimea.edu>
17 * 17 *
18 * 27/11/2000 Initial release 18 * 27/11/2000 Initial release
19 */ 19 */
20#include <linux/module.h> 20#include <linux/module.h>
21#include <linux/moduleparam.h> 21#include <linux/moduleparam.h>
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c
index 3266daaaecf8..d1c390c7155c 100644
--- a/drivers/watchdog/sbc60xxwdt.c
+++ b/drivers/watchdog/sbc60xxwdt.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * 60xx Single Board Computer Watchdog Timer driver for Linux 2.2.x 2 * 60xx Single Board Computer Watchdog Timer driver for Linux 2.2.x
3 * 3 *
4 * Based on acquirewdt.c by Alan Cox. 4 * Based on acquirewdt.c by Alan Cox.
5 * 5 *
6 * This program is free software; you can redistribute it and/or 6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 7 * modify it under the terms of the GNU General Public License
diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c
index ae74f6bcfa23..b6e6799ec45d 100644
--- a/drivers/watchdog/sbc8360.c
+++ b/drivers/watchdog/sbc8360.c
@@ -4,12 +4,12 @@
4 * (c) Copyright 2005 Webcon, Inc. 4 * (c) Copyright 2005 Webcon, Inc.
5 * 5 *
6 * Based on ib700wdt.c, which is based on advantechwdt.c which is based 6 * Based on ib700wdt.c, which is based on advantechwdt.c which is based
7 * on acquirewdt.c which is based on wdt.c. 7 * on acquirewdt.c which is based on wdt.c.
8 * 8 *
9 * (c) Copyright 2001 Charles Howes <chowes@vsol.net> 9 * (c) Copyright 2001 Charles Howes <chowes@vsol.net>
10 * 10 *
11 * Based on advantechwdt.c which is based on acquirewdt.c which 11 * Based on advantechwdt.c which is based on acquirewdt.c which
12 * is based on wdt.c. 12 * is based on wdt.c.
13 * 13 *
14 * (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl> 14 * (c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>
15 * 15 *
@@ -30,9 +30,9 @@
30 * 30 *
31 * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> 31 * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>
32 * 32 *
33 * 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com> 33 * 14-Dec-2001 Matt Domsch <Matt_Domsch@dell.com>
34 * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT 34 * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT
35 * Added timeout module option to override default 35 * Added timeout module option to override default
36 * 36 *
37 */ 37 */
38 38
diff --git a/drivers/watchdog/sbc_epx_c3.c b/drivers/watchdog/sbc_epx_c3.c
index 06553debc7bc..e467ddcf796a 100644
--- a/drivers/watchdog/sbc_epx_c3.c
+++ b/drivers/watchdog/sbc_epx_c3.c
@@ -35,7 +35,8 @@ static int epx_c3_alive;
35 35
36static int nowayout = WATCHDOG_NOWAYOUT; 36static int nowayout = WATCHDOG_NOWAYOUT;
37module_param(nowayout, int, 0); 37module_param(nowayout, int, 0);
38MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=" __MODULE_STRING(WATCHDOG_NOWAYOUT) ")"); 38MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
39 __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
39 40
40#define EPXC3_WATCHDOG_CTL_REG 0x1ee /* write 1 to enable, 0 to disable */ 41#define EPXC3_WATCHDOG_CTL_REG 0x1ee /* write 1 to enable, 0 to disable */
41#define EPXC3_WATCHDOG_PET_REG 0x1ef /* write anything to pet once enabled */ 42#define EPXC3_WATCHDOG_PET_REG 0x1ef /* write anything to pet once enabled */
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c
index 23da3ccd832a..b5e19c1820a2 100644
--- a/drivers/watchdog/sc1200wdt.c
+++ b/drivers/watchdog/sc1200wdt.c
@@ -71,7 +71,7 @@
71#define UART2_IRQ 0x04 /* Serial1 */ 71#define UART2_IRQ 0x04 /* Serial1 */
72/* 5 -7 are reserved */ 72/* 5 -7 are reserved */
73 73
74static char banner[] __initdata = KERN_INFO PFX SC1200_MODULE_VER; 74static char banner[] __initdata = PFX SC1200_MODULE_VER;
75static int timeout = 1; 75static int timeout = 1;
76static int io = -1; 76static int io = -1;
77static int io_len = 2; /* for non plug and play */ 77static int io_len = 2; /* for non plug and play */
@@ -392,7 +392,7 @@ static int __init sc1200wdt_init(void)
392{ 392{
393 int ret; 393 int ret;
394 394
395 printk("%s\n", banner); 395 printk(KERN_INFO "%s\n", banner);
396 396
397#if defined CONFIG_PNP 397#if defined CONFIG_PNP
398 if (isapnp) { 398 if (isapnp) {
@@ -477,6 +477,7 @@ module_init(sc1200wdt_init);
477module_exit(sc1200wdt_exit); 477module_exit(sc1200wdt_exit);
478 478
479MODULE_AUTHOR("Zwane Mwaikambo <zwane@commfireservices.com>"); 479MODULE_AUTHOR("Zwane Mwaikambo <zwane@commfireservices.com>");
480MODULE_DESCRIPTION("Driver for National Semiconductor PC87307/PC97307 watchdog component"); 480MODULE_DESCRIPTION(
481 "Driver for National Semiconductor PC87307/PC97307 watchdog component");
481MODULE_LICENSE("GPL"); 482MODULE_LICENSE("GPL");
482MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 483MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c
index a2b6c1067ec5..52b63f2f0dac 100644
--- a/drivers/watchdog/sc520_wdt.c
+++ b/drivers/watchdog/sc520_wdt.c
@@ -1,8 +1,8 @@
1/* 1/*
2 * AMD Elan SC520 processor Watchdog Timer driver 2 * AMD Elan SC520 processor Watchdog Timer driver
3 * 3 *
4 * Based on acquirewdt.c by Alan Cox, 4 * Based on acquirewdt.c by Alan Cox,
5 * and sbc60xxwdt.c by Jakob Oestergaard <jakob@unthought.net> 5 * and sbc60xxwdt.c by Jakob Oestergaard <jakob@unthought.net>
6 * 6 *
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
@@ -11,7 +11,7 @@
11 * 11 *
12 * The authors do NOT admit liability nor provide warranty for 12 * The authors do NOT admit liability nor provide warranty for
13 * any of this software. This material is provided "AS-IS" in 13 * any of this software. This material is provided "AS-IS" in
14 * the hope that it may be useful for others. 14 * the hope that it may be useful for others.
15 * 15 *
16 * (c) Copyright 2001 Scott Jennings <linuxdrivers@oro.net> 16 * (c) Copyright 2001 Scott Jennings <linuxdrivers@oro.net>
17 * 9/27 - 2001 [Initial release] 17 * 9/27 - 2001 [Initial release]
@@ -438,6 +438,7 @@ module_init(sc520_wdt_init);
438module_exit(sc520_wdt_unload); 438module_exit(sc520_wdt_unload);
439 439
440MODULE_AUTHOR("Scott and Bill Jennings"); 440MODULE_AUTHOR("Scott and Bill Jennings");
441MODULE_DESCRIPTION("Driver for watchdog timer in AMD \"Elan\" SC520 uProcessor"); 441MODULE_DESCRIPTION(
442 "Driver for watchdog timer in AMD \"Elan\" SC520 uProcessor");
442MODULE_LICENSE("GPL"); 443MODULE_LICENSE("GPL");
443MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 444MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c
index 2e56cad77d19..8a1f0bc3e271 100644
--- a/drivers/watchdog/smsc37b787_wdt.c
+++ b/drivers/watchdog/smsc37b787_wdt.c
@@ -2,7 +2,7 @@
2 * SMsC 37B787 Watchdog Timer driver for Linux 2.6.x.x 2 * SMsC 37B787 Watchdog Timer driver for Linux 2.6.x.x
3 * 3 *
4 * Based on acquirewdt.c by Alan Cox <alan@lxorguk.ukuu.org.uk> 4 * Based on acquirewdt.c by Alan Cox <alan@lxorguk.ukuu.org.uk>
5 * and some other existing drivers 5 * and some other existing drivers
6 * 6 *
7 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
@@ -11,7 +11,7 @@
11 * 11 *
12 * The authors do NOT admit liability nor provide warranty for 12 * The authors do NOT admit liability nor provide warranty for
13 * any of this software. This material is provided "AS-IS" in 13 * any of this software. This material is provided "AS-IS" in
14 * the hope that it may be useful for others. 14 * the hope that it may be useful for others.
15 * 15 *
16 * (C) Copyright 2003-2006 Sven Anders <anders@anduras.de> 16 * (C) Copyright 2003-2006 Sven Anders <anders@anduras.de>
17 * 17 *
@@ -22,19 +22,19 @@
22 * 22 *
23 * Theory of operation: 23 * Theory of operation:
24 * 24 *
25 * A Watchdog Timer (WDT) is a hardware circuit that can 25 * A Watchdog Timer (WDT) is a hardware circuit that can
26 * reset the computer system in case of a software fault. 26 * reset the computer system in case of a software fault.
27 * You probably knew that already. 27 * You probably knew that already.
28 * 28 *
29 * Usually a userspace daemon will notify the kernel WDT driver 29 * Usually a userspace daemon will notify the kernel WDT driver
30 * via the /dev/watchdog special device file that userspace is 30 * via the /dev/watchdog special device file that userspace is
31 * still alive, at regular intervals. When such a notification 31 * still alive, at regular intervals. When such a notification
32 * occurs, the driver will usually tell the hardware watchdog 32 * occurs, the driver will usually tell the hardware watchdog
33 * that everything is in order, and that the watchdog should wait 33 * that everything is in order, and that the watchdog should wait
34 * for yet another little while to reset the system. 34 * for yet another little while to reset the system.
35 * If userspace fails (RAM error, kernel bug, whatever), the 35 * If userspace fails (RAM error, kernel bug, whatever), the
36 * notifications cease to occur, and the hardware watchdog will 36 * notifications cease to occur, and the hardware watchdog will
37 * reset the system (causing a reboot) after the timeout occurs. 37 * reset the system (causing a reboot) after the timeout occurs.
38 * 38 *
39 * Create device with: 39 * Create device with:
40 * mknod /dev/watchdog c 10 130 40 * mknod /dev/watchdog c 10 130
@@ -485,7 +485,7 @@ static long wb_smsc_wdt_ioctl(struct file *file,
485 case WDIOC_GETTIMEOUT: 485 case WDIOC_GETTIMEOUT:
486 new_timeout = timeout; 486 new_timeout = timeout;
487 if (unit == UNIT_MINUTE) 487 if (unit == UNIT_MINUTE)
488 new_timeout *= 60; 488 new_timeout *= 60;
489 return put_user(new_timeout, uarg.i); 489 return put_user(new_timeout, uarg.i);
490 default: 490 default:
491 return -ENOTTY; 491 return -ENOTTY;
diff --git a/drivers/watchdog/softdog.c b/drivers/watchdog/softdog.c
index 7204f9662114..ebcc9cea5e99 100644
--- a/drivers/watchdog/softdog.c
+++ b/drivers/watchdog/softdog.c
@@ -1,7 +1,8 @@
1/* 1/*
2 * SoftDog 0.07: A Software Watchdog Device 2 * SoftDog 0.07: A Software Watchdog Device
3 * 3 *
4 * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>, All Rights Reserved. 4 * (c) Copyright 1996 Alan Cox <alan@lxorguk.ukuu.org.uk>,
5 * All Rights Reserved.
5 * 6 *
6 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
@@ -32,7 +33,7 @@
32 * Added WDIOC_GETTIMEOUT and WDIOC_SETTIMOUT. 33 * Added WDIOC_GETTIMEOUT and WDIOC_SETTIMOUT.
33 * 34 *
34 * 20020530 Joel Becker <joel.becker@oracle.com> 35 * 20020530 Joel Becker <joel.becker@oracle.com>
35 * Added Matt Domsch's nowayout module option. 36 * Added Matt Domsch's nowayout module option.
36 */ 37 */
37 38
38#include <linux/module.h> 39#include <linux/module.h>
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c
index 3c7aa412b1f3..a9c7f352fcbf 100644
--- a/drivers/watchdog/w83697hf_wdt.c
+++ b/drivers/watchdog/w83697hf_wdt.c
@@ -462,6 +462,7 @@ module_init(wdt_init);
462module_exit(wdt_exit); 462module_exit(wdt_exit);
463 463
464MODULE_LICENSE("GPL"); 464MODULE_LICENSE("GPL");
465MODULE_AUTHOR("Marcus Junker <junker@anduras.de>, Samuel Tardieu <sam@rfc1149.net>"); 465MODULE_AUTHOR("Marcus Junker <junker@anduras.de>, "
466 "Samuel Tardieu <sam@rfc1149.net>");
466MODULE_DESCRIPTION("w83697hf/hg WDT driver"); 467MODULE_DESCRIPTION("w83697hf/hg WDT driver");
467MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR); 468MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
diff --git a/drivers/watchdog/w83697ug_wdt.c b/drivers/watchdog/w83697ug_wdt.c
index 6972c0a1e4d6..883b5f79673a 100644
--- a/drivers/watchdog/w83697ug_wdt.c
+++ b/drivers/watchdog/w83697ug_wdt.c
@@ -2,7 +2,7 @@
2 * w83697ug/uf WDT driver 2 * w83697ug/uf WDT driver
3 * 3 *
4 * (c) Copyright 2008 Flemming Fransen <ff@nrvissing.net> 4 * (c) Copyright 2008 Flemming Fransen <ff@nrvissing.net>
5 * reused original code to supoprt w83697ug/uf. 5 * reused original code to support w83697ug/uf.
6 * 6 *
7 * Based on w83627hf_wdt.c which is based on advantechwdt.c 7 * Based on w83627hf_wdt.c which is based on advantechwdt.c
8 * which is based on wdt.c. 8 * which is based on wdt.c.
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c
index 2525da5080ca..0560182a1d09 100644
--- a/drivers/watchdog/w83977f_wdt.c
+++ b/drivers/watchdog/w83977f_wdt.c
@@ -426,7 +426,7 @@ static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
426 return -EFAULT; 426 return -EFAULT;
427 427
428 if (wdt_set_timeout(new_timeout)) 428 if (wdt_set_timeout(new_timeout))
429 return -EINVAL; 429 return -EINVAL;
430 430
431 wdt_keepalive(); 431 wdt_keepalive();
432 /* Fall */ 432 /* Fall */
diff --git a/drivers/watchdog/wd501p.h b/drivers/watchdog/wd501p.h
index db34853c28ae..0e3a497d5626 100644
--- a/drivers/watchdog/wd501p.h
+++ b/drivers/watchdog/wd501p.h
@@ -11,9 +11,9 @@
11 * 11 *
12 * http://www.cymru.net 12 * http://www.cymru.net
13 * 13 *
14 * This driver is provided under the GNU General Public License, incorporated 14 * This driver is provided under the GNU General Public License,
15 * herein by reference. The driver is provided without warranty or 15 * incorporated herein by reference. The driver is provided without
16 * support. 16 * warranty or support.
17 * 17 *
18 * Release 0.04. 18 * Release 0.04.
19 * 19 *
@@ -39,13 +39,13 @@
39/* programmable outputs: */ 39/* programmable outputs: */
40#define WDT_PROGOUT (io+15) /* wr=enable, rd=disable */ 40#define WDT_PROGOUT (io+15) /* wr=enable, rd=disable */
41 41
42 /* FAN 501 500 */ 42 /* FAN 501 500 */
43#define WDC_SR_WCCR 1 /* Active low */ /* X X X */ 43#define WDC_SR_WCCR 1 /* Active low */ /* X X X */
44#define WDC_SR_TGOOD 2 /* X X - */ 44#define WDC_SR_TGOOD 2 /* X X - */
45#define WDC_SR_ISOI0 4 /* X X X */ 45#define WDC_SR_ISOI0 4 /* X X X */
46#define WDC_SR_ISII1 8 /* X X X */ 46#define WDC_SR_ISII1 8 /* X X X */
47#define WDC_SR_FANGOOD 16 /* X - - */ 47#define WDC_SR_FANGOOD 16 /* X - - */
48#define WDC_SR_PSUOVER 32 /* Active low */ /* X X - */ 48#define WDC_SR_PSUOVER 32 /* Active low */ /* X X - */
49#define WDC_SR_PSUUNDR 64 /* Active low */ /* X X - */ 49#define WDC_SR_PSUUNDR 64 /* Active low */ /* X X - */
50#define WDC_SR_IRQ 128 /* Active low */ /* X X X */ 50#define WDC_SR_IRQ 128 /* Active low */ /* X X X */
51 51
diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c
index 60e28d49ff52..90ef70eb47d7 100644
--- a/drivers/watchdog/wdt977.c
+++ b/drivers/watchdog/wdt977.c
@@ -401,7 +401,7 @@ static long wdt977_ioctl(struct file *file, unsigned int cmd,
401 return -EFAULT; 401 return -EFAULT;
402 402
403 if (wdt977_set_timeout(new_timeout)) 403 if (wdt977_set_timeout(new_timeout))
404 return -EINVAL; 404 return -EINVAL;
405 405
406 wdt977_keepalive(); 406 wdt977_keepalive();
407 /* Fall */ 407 /* Fall */