aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/watchdog/pcwd.c
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/pcwd.c
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/pcwd.c')
-rw-r--r--drivers/watchdog/pcwd.c44
1 files changed, 25 insertions, 19 deletions
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");