diff options
author | Joe Perches <joe@perches.com> | 2012-02-15 18:06:19 -0500 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2012-03-27 13:59:26 -0400 |
commit | 27c766aaacb265d625dc634bf7903f7f9fd0c697 (patch) | |
tree | 06b399d21dec006bc0a3e1c6685b076753e19b94 | |
parent | 7cbc353540c31ffaf65ad44d89b955be0f1d04dc (diff) |
watchdog: Use pr_<fmt> and pr_<level>
Use the current logging styles.
Make sure all output has a prefix.
Add missing newlines.
Remove now unnecessary PFX, NAME, and miscellaneous other #defines.
Coalesce formats.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
90 files changed, 1039 insertions, 1280 deletions
diff --git a/drivers/watchdog/acquirewdt.c b/drivers/watchdog/acquirewdt.c index b6a2b58cbe64..8947ccd71efc 100644 --- a/drivers/watchdog/acquirewdt.c +++ b/drivers/watchdog/acquirewdt.c | |||
@@ -52,6 +52,8 @@ | |||
52 | * Includes, defines, variables, module parameters, ... | 52 | * Includes, defines, variables, module parameters, ... |
53 | */ | 53 | */ |
54 | 54 | ||
55 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
56 | |||
55 | /* Includes */ | 57 | /* Includes */ |
56 | #include <linux/module.h> /* For module specific items */ | 58 | #include <linux/module.h> /* For module specific items */ |
57 | #include <linux/moduleparam.h> /* For new moduleparam's */ | 59 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
@@ -70,7 +72,6 @@ | |||
70 | 72 | ||
71 | /* Module information */ | 73 | /* Module information */ |
72 | #define DRV_NAME "acquirewdt" | 74 | #define DRV_NAME "acquirewdt" |
73 | #define PFX DRV_NAME ": " | ||
74 | #define WATCHDOG_NAME "Acquire WDT" | 75 | #define WATCHDOG_NAME "Acquire WDT" |
75 | /* There is no way to see what the correct time-out period is */ | 76 | /* There is no way to see what the correct time-out period is */ |
76 | #define WATCHDOG_HEARTBEAT 0 | 77 | #define WATCHDOG_HEARTBEAT 0 |
@@ -208,8 +209,7 @@ static int acq_close(struct inode *inode, struct file *file) | |||
208 | if (expect_close == 42) { | 209 | if (expect_close == 42) { |
209 | acq_stop(); | 210 | acq_stop(); |
210 | } else { | 211 | } else { |
211 | printk(KERN_CRIT PFX | 212 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
212 | "Unexpected close, not stopping watchdog!\n"); | ||
213 | acq_keepalive(); | 213 | acq_keepalive(); |
214 | } | 214 | } |
215 | clear_bit(0, &acq_is_open); | 215 | clear_bit(0, &acq_is_open); |
@@ -246,27 +246,24 @@ static int __devinit acq_probe(struct platform_device *dev) | |||
246 | 246 | ||
247 | if (wdt_stop != wdt_start) { | 247 | if (wdt_stop != wdt_start) { |
248 | if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { | 248 | if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { |
249 | printk(KERN_ERR PFX | 249 | pr_err("I/O address 0x%04x already in use\n", wdt_stop); |
250 | "I/O address 0x%04x already in use\n", wdt_stop); | ||
251 | ret = -EIO; | 250 | ret = -EIO; |
252 | goto out; | 251 | goto out; |
253 | } | 252 | } |
254 | } | 253 | } |
255 | 254 | ||
256 | if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { | 255 | if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { |
257 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 256 | pr_err("I/O address 0x%04x already in use\n", wdt_start); |
258 | wdt_start); | ||
259 | ret = -EIO; | 257 | ret = -EIO; |
260 | goto unreg_stop; | 258 | goto unreg_stop; |
261 | } | 259 | } |
262 | ret = misc_register(&acq_miscdev); | 260 | ret = misc_register(&acq_miscdev); |
263 | if (ret != 0) { | 261 | if (ret != 0) { |
264 | printk(KERN_ERR PFX | 262 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
265 | "cannot register miscdev on minor=%d (err=%d)\n", | 263 | WATCHDOG_MINOR, ret); |
266 | WATCHDOG_MINOR, ret); | ||
267 | goto unreg_regions; | 264 | goto unreg_regions; |
268 | } | 265 | } |
269 | printk(KERN_INFO PFX "initialized. (nowayout=%d)\n", nowayout); | 266 | pr_info("initialized. (nowayout=%d)\n", nowayout); |
270 | 267 | ||
271 | return 0; | 268 | return 0; |
272 | unreg_regions: | 269 | unreg_regions: |
@@ -308,8 +305,7 @@ static int __init acq_init(void) | |||
308 | { | 305 | { |
309 | int err; | 306 | int err; |
310 | 307 | ||
311 | printk(KERN_INFO | 308 | pr_info("WDT driver for Acquire single board computer initialising\n"); |
312 | "WDT driver for Acquire single board computer initialising.\n"); | ||
313 | 309 | ||
314 | err = platform_driver_register(&acquirewdt_driver); | 310 | err = platform_driver_register(&acquirewdt_driver); |
315 | if (err) | 311 | if (err) |
@@ -332,7 +328,7 @@ static void __exit acq_exit(void) | |||
332 | { | 328 | { |
333 | platform_device_unregister(acq_platform_device); | 329 | platform_device_unregister(acq_platform_device); |
334 | platform_driver_unregister(&acquirewdt_driver); | 330 | platform_driver_unregister(&acquirewdt_driver); |
335 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 331 | pr_info("Watchdog Module Unloaded\n"); |
336 | } | 332 | } |
337 | 333 | ||
338 | module_init(acq_init); | 334 | module_init(acq_init); |
diff --git a/drivers/watchdog/advantechwdt.c b/drivers/watchdog/advantechwdt.c index 4d40965d2c9f..986258a06676 100644 --- a/drivers/watchdog/advantechwdt.c +++ b/drivers/watchdog/advantechwdt.c | |||
@@ -28,6 +28,8 @@ | |||
28 | * add wdt_start and wdt_stop as parameters. | 28 | * add wdt_start and wdt_stop as parameters. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
32 | |||
31 | #include <linux/module.h> | 33 | #include <linux/module.h> |
32 | #include <linux/moduleparam.h> | 34 | #include <linux/moduleparam.h> |
33 | #include <linux/types.h> | 35 | #include <linux/types.h> |
@@ -43,7 +45,6 @@ | |||
43 | #include <asm/system.h> | 45 | #include <asm/system.h> |
44 | 46 | ||
45 | #define DRV_NAME "advantechwdt" | 47 | #define DRV_NAME "advantechwdt" |
46 | #define PFX DRV_NAME ": " | ||
47 | #define WATCHDOG_NAME "Advantech WDT" | 48 | #define WATCHDOG_NAME "Advantech WDT" |
48 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 49 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
49 | 50 | ||
@@ -207,8 +208,7 @@ static int advwdt_close(struct inode *inode, struct file *file) | |||
207 | if (adv_expect_close == 42) { | 208 | if (adv_expect_close == 42) { |
208 | advwdt_disable(); | 209 | advwdt_disable(); |
209 | } else { | 210 | } else { |
210 | printk(KERN_CRIT PFX | 211 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
211 | "Unexpected close, not stopping watchdog!\n"); | ||
212 | advwdt_ping(); | 212 | advwdt_ping(); |
213 | } | 213 | } |
214 | clear_bit(0, &advwdt_is_open); | 214 | clear_bit(0, &advwdt_is_open); |
@@ -245,18 +245,15 @@ static int __devinit advwdt_probe(struct platform_device *dev) | |||
245 | 245 | ||
246 | if (wdt_stop != wdt_start) { | 246 | if (wdt_stop != wdt_start) { |
247 | if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { | 247 | if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { |
248 | printk(KERN_ERR PFX | 248 | pr_err("I/O address 0x%04x already in use\n", |
249 | "I/O address 0x%04x already in use\n", | 249 | wdt_stop); |
250 | wdt_stop); | ||
251 | ret = -EIO; | 250 | ret = -EIO; |
252 | goto out; | 251 | goto out; |
253 | } | 252 | } |
254 | } | 253 | } |
255 | 254 | ||
256 | if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { | 255 | if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { |
257 | printk(KERN_ERR PFX | 256 | pr_err("I/O address 0x%04x already in use\n", wdt_start); |
258 | "I/O address 0x%04x already in use\n", | ||
259 | wdt_start); | ||
260 | ret = -EIO; | 257 | ret = -EIO; |
261 | goto unreg_stop; | 258 | goto unreg_stop; |
262 | } | 259 | } |
@@ -265,18 +262,16 @@ static int __devinit advwdt_probe(struct platform_device *dev) | |||
265 | * if not reset to the default */ | 262 | * if not reset to the default */ |
266 | if (advwdt_set_heartbeat(timeout)) { | 263 | if (advwdt_set_heartbeat(timeout)) { |
267 | advwdt_set_heartbeat(WATCHDOG_TIMEOUT); | 264 | advwdt_set_heartbeat(WATCHDOG_TIMEOUT); |
268 | printk(KERN_INFO PFX | 265 | pr_info("timeout value must be 1<=x<=63, using %d\n", timeout); |
269 | "timeout value must be 1<=x<=63, using %d\n", timeout); | ||
270 | } | 266 | } |
271 | 267 | ||
272 | ret = misc_register(&advwdt_miscdev); | 268 | ret = misc_register(&advwdt_miscdev); |
273 | if (ret != 0) { | 269 | if (ret != 0) { |
274 | printk(KERN_ERR PFX | 270 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
275 | "cannot register miscdev on minor=%d (err=%d)\n", | 271 | WATCHDOG_MINOR, ret); |
276 | WATCHDOG_MINOR, ret); | ||
277 | goto unreg_regions; | 272 | goto unreg_regions; |
278 | } | 273 | } |
279 | printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | 274 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
280 | timeout, nowayout); | 275 | timeout, nowayout); |
281 | out: | 276 | out: |
282 | return ret; | 277 | return ret; |
@@ -318,8 +313,7 @@ static int __init advwdt_init(void) | |||
318 | { | 313 | { |
319 | int err; | 314 | int err; |
320 | 315 | ||
321 | printk(KERN_INFO | 316 | pr_info("WDT driver for Advantech single board computer initialising\n"); |
322 | "WDT driver for Advantech single board computer initialising.\n"); | ||
323 | 317 | ||
324 | err = platform_driver_register(&advwdt_driver); | 318 | err = platform_driver_register(&advwdt_driver); |
325 | if (err) | 319 | if (err) |
@@ -343,7 +337,7 @@ static void __exit advwdt_exit(void) | |||
343 | { | 337 | { |
344 | platform_device_unregister(advwdt_platform_device); | 338 | platform_device_unregister(advwdt_platform_device); |
345 | platform_driver_unregister(&advwdt_driver); | 339 | platform_driver_unregister(&advwdt_driver); |
346 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 340 | pr_info("Watchdog Module Unloaded\n"); |
347 | } | 341 | } |
348 | 342 | ||
349 | module_init(advwdt_init); | 343 | module_init(advwdt_init); |
diff --git a/drivers/watchdog/alim1535_wdt.c b/drivers/watchdog/alim1535_wdt.c index f16dcbd475fb..e802f5e02418 100644 --- a/drivers/watchdog/alim1535_wdt.c +++ b/drivers/watchdog/alim1535_wdt.c | |||
@@ -7,6 +7,8 @@ | |||
7 | * 2 of the License, or (at your option) any later version. | 7 | * 2 of the License, or (at your option) any later version. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
11 | |||
10 | #include <linux/module.h> | 12 | #include <linux/module.h> |
11 | #include <linux/moduleparam.h> | 13 | #include <linux/moduleparam.h> |
12 | #include <linux/types.h> | 14 | #include <linux/types.h> |
@@ -22,7 +24,6 @@ | |||
22 | #include <linux/io.h> | 24 | #include <linux/io.h> |
23 | 25 | ||
24 | #define WATCHDOG_NAME "ALi_M1535" | 26 | #define WATCHDOG_NAME "ALi_M1535" |
25 | #define PFX WATCHDOG_NAME ": " | ||
26 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 27 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
27 | 28 | ||
28 | /* internal variables */ | 29 | /* internal variables */ |
@@ -268,8 +269,7 @@ static int ali_release(struct inode *inode, struct file *file) | |||
268 | if (ali_expect_release == 42) | 269 | if (ali_expect_release == 42) |
269 | ali_stop(); | 270 | ali_stop(); |
270 | else { | 271 | else { |
271 | printk(KERN_CRIT PFX | 272 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
272 | "Unexpected close, not stopping watchdog!\n"); | ||
273 | ali_keepalive(); | 273 | ali_keepalive(); |
274 | } | 274 | } |
275 | clear_bit(0, &ali_is_open); | 275 | clear_bit(0, &ali_is_open); |
@@ -399,9 +399,8 @@ static int __init watchdog_init(void) | |||
399 | if not reset to the default */ | 399 | if not reset to the default */ |
400 | if (timeout < 1 || timeout >= 18000) { | 400 | if (timeout < 1 || timeout >= 18000) { |
401 | timeout = WATCHDOG_TIMEOUT; | 401 | timeout = WATCHDOG_TIMEOUT; |
402 | printk(KERN_INFO PFX | 402 | pr_info("timeout value must be 0 < timeout < 18000, using %d\n", |
403 | "timeout value must be 0 < timeout < 18000, using %d\n", | 403 | timeout); |
404 | timeout); | ||
405 | } | 404 | } |
406 | 405 | ||
407 | /* Calculate the watchdog's timeout */ | 406 | /* Calculate the watchdog's timeout */ |
@@ -409,20 +408,18 @@ static int __init watchdog_init(void) | |||
409 | 408 | ||
410 | ret = register_reboot_notifier(&ali_notifier); | 409 | ret = register_reboot_notifier(&ali_notifier); |
411 | if (ret != 0) { | 410 | if (ret != 0) { |
412 | printk(KERN_ERR PFX | 411 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
413 | "cannot register reboot notifier (err=%d)\n", ret); | ||
414 | goto out; | 412 | goto out; |
415 | } | 413 | } |
416 | 414 | ||
417 | ret = misc_register(&ali_miscdev); | 415 | ret = misc_register(&ali_miscdev); |
418 | if (ret != 0) { | 416 | if (ret != 0) { |
419 | printk(KERN_ERR PFX | 417 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
420 | "cannot register miscdev on minor=%d (err=%d)\n", | 418 | WATCHDOG_MINOR, ret); |
421 | WATCHDOG_MINOR, ret); | ||
422 | goto unreg_reboot; | 419 | goto unreg_reboot; |
423 | } | 420 | } |
424 | 421 | ||
425 | printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | 422 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
426 | timeout, nowayout); | 423 | timeout, nowayout); |
427 | 424 | ||
428 | out: | 425 | out: |
diff --git a/drivers/watchdog/alim7101_wdt.c b/drivers/watchdog/alim7101_wdt.c index 46f4b85b46de..e90f4ce32799 100644 --- a/drivers/watchdog/alim7101_wdt.c +++ b/drivers/watchdog/alim7101_wdt.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * -- Mike Waychison <michael.waychison@sun.com> | 19 | * -- Mike Waychison <michael.waychison@sun.com> |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #include <linux/module.h> | 24 | #include <linux/module.h> |
23 | #include <linux/moduleparam.h> | 25 | #include <linux/moduleparam.h> |
24 | #include <linux/types.h> | 26 | #include <linux/types.h> |
@@ -36,9 +38,6 @@ | |||
36 | 38 | ||
37 | #include <asm/system.h> | 39 | #include <asm/system.h> |
38 | 40 | ||
39 | #define OUR_NAME "alim7101_wdt" | ||
40 | #define PFX OUR_NAME ": " | ||
41 | |||
42 | #define WDT_ENABLE 0x9C | 41 | #define WDT_ENABLE 0x9C |
43 | #define WDT_DISABLE 0x8C | 42 | #define WDT_DISABLE 0x8C |
44 | 43 | ||
@@ -112,8 +111,7 @@ static void wdt_timer_ping(unsigned long data) | |||
112 | ALI_7101_GPIO_O, tmp & ~0x20); | 111 | ALI_7101_GPIO_O, tmp & ~0x20); |
113 | } | 112 | } |
114 | } else { | 113 | } else { |
115 | printk(KERN_WARNING PFX | 114 | pr_warn("Heartbeat lost! Will not ping the watchdog\n"); |
116 | "Heartbeat lost! Will not ping the watchdog\n"); | ||
117 | } | 115 | } |
118 | /* Re-set the timer interval */ | 116 | /* Re-set the timer interval */ |
119 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 117 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
@@ -162,7 +160,7 @@ static void wdt_startup(void) | |||
162 | /* Start the timer */ | 160 | /* Start the timer */ |
163 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 161 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
164 | 162 | ||
165 | printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); | 163 | pr_info("Watchdog timer is now enabled\n"); |
166 | } | 164 | } |
167 | 165 | ||
168 | static void wdt_turnoff(void) | 166 | static void wdt_turnoff(void) |
@@ -170,7 +168,7 @@ static void wdt_turnoff(void) | |||
170 | /* Stop the timer */ | 168 | /* Stop the timer */ |
171 | del_timer_sync(&timer); | 169 | del_timer_sync(&timer); |
172 | wdt_change(WDT_DISABLE); | 170 | wdt_change(WDT_DISABLE); |
173 | printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); | 171 | pr_info("Watchdog timer is now disabled...\n"); |
174 | } | 172 | } |
175 | 173 | ||
176 | static void wdt_keepalive(void) | 174 | static void wdt_keepalive(void) |
@@ -226,8 +224,7 @@ static int fop_close(struct inode *inode, struct file *file) | |||
226 | wdt_turnoff(); | 224 | wdt_turnoff(); |
227 | else { | 225 | else { |
228 | /* wim: shouldn't there be a: del_timer(&timer); */ | 226 | /* wim: shouldn't there be a: del_timer(&timer); */ |
229 | printk(KERN_CRIT PFX | 227 | pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); |
230 | "device file closed unexpectedly. Will not stop the WDT!\n"); | ||
231 | } | 228 | } |
232 | clear_bit(0, &wdt_is_open); | 229 | clear_bit(0, &wdt_is_open); |
233 | wdt_expect_close = 0; | 230 | wdt_expect_close = 0; |
@@ -322,8 +319,7 @@ static int wdt_notify_sys(struct notifier_block *this, | |||
322 | * watchdog on reboot with no heartbeat | 319 | * watchdog on reboot with no heartbeat |
323 | */ | 320 | */ |
324 | wdt_change(WDT_ENABLE); | 321 | wdt_change(WDT_ENABLE); |
325 | printk(KERN_INFO PFX "Watchdog timer is now enabled " | 322 | pr_info("Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second\n"); |
326 | "with no heartbeat - should reboot in ~1 second.\n"); | ||
327 | } | 323 | } |
328 | return NOTIFY_DONE; | 324 | return NOTIFY_DONE; |
329 | } | 325 | } |
@@ -352,12 +348,11 @@ static int __init alim7101_wdt_init(void) | |||
352 | struct pci_dev *ali1543_south; | 348 | struct pci_dev *ali1543_south; |
353 | char tmp; | 349 | char tmp; |
354 | 350 | ||
355 | printk(KERN_INFO PFX "Steve Hill <steve@navaho.co.uk>.\n"); | 351 | pr_info("Steve Hill <steve@navaho.co.uk>\n"); |
356 | alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, | 352 | alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, |
357 | NULL); | 353 | NULL); |
358 | if (!alim7101_pmu) { | 354 | if (!alim7101_pmu) { |
359 | printk(KERN_INFO PFX | 355 | pr_info("ALi M7101 PMU not present - WDT not set\n"); |
360 | "ALi M7101 PMU not present - WDT not set\n"); | ||
361 | return -EBUSY; | 356 | return -EBUSY; |
362 | } | 357 | } |
363 | 358 | ||
@@ -367,56 +362,46 @@ static int __init alim7101_wdt_init(void) | |||
367 | ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, | 362 | ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, |
368 | NULL); | 363 | NULL); |
369 | if (!ali1543_south) { | 364 | if (!ali1543_south) { |
370 | printk(KERN_INFO PFX | 365 | pr_info("ALi 1543 South-Bridge not present - WDT not set\n"); |
371 | "ALi 1543 South-Bridge not present - WDT not set\n"); | ||
372 | goto err_out; | 366 | goto err_out; |
373 | } | 367 | } |
374 | pci_read_config_byte(ali1543_south, 0x5e, &tmp); | 368 | pci_read_config_byte(ali1543_south, 0x5e, &tmp); |
375 | pci_dev_put(ali1543_south); | 369 | pci_dev_put(ali1543_south); |
376 | if ((tmp & 0x1e) == 0x00) { | 370 | if ((tmp & 0x1e) == 0x00) { |
377 | if (!use_gpio) { | 371 | if (!use_gpio) { |
378 | printk(KERN_INFO PFX | 372 | pr_info("Detected old alim7101 revision 'a1d'. If this is a cobalt board, set the 'use_gpio' module parameter.\n"); |
379 | "Detected old alim7101 revision 'a1d'. " | ||
380 | "If this is a cobalt board, set the 'use_gpio' " | ||
381 | "module parameter.\n"); | ||
382 | goto err_out; | 373 | goto err_out; |
383 | } | 374 | } |
384 | nowayout = 1; | 375 | nowayout = 1; |
385 | } else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) { | 376 | } else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) { |
386 | printk(KERN_INFO PFX | 377 | pr_info("ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n"); |
387 | "ALi 1543 South-Bridge does not have the correct " | ||
388 | "revision number (???1001?) - WDT not set\n"); | ||
389 | goto err_out; | 378 | goto err_out; |
390 | } | 379 | } |
391 | 380 | ||
392 | if (timeout < 1 || timeout > 3600) { | 381 | if (timeout < 1 || timeout > 3600) { |
393 | /* arbitrary upper limit */ | 382 | /* arbitrary upper limit */ |
394 | timeout = WATCHDOG_TIMEOUT; | 383 | timeout = WATCHDOG_TIMEOUT; |
395 | printk(KERN_INFO PFX | 384 | pr_info("timeout value must be 1 <= x <= 3600, using %d\n", |
396 | "timeout value must be 1 <= x <= 3600, using %d\n", | 385 | timeout); |
397 | timeout); | ||
398 | } | 386 | } |
399 | 387 | ||
400 | rc = register_reboot_notifier(&wdt_notifier); | 388 | rc = register_reboot_notifier(&wdt_notifier); |
401 | if (rc) { | 389 | if (rc) { |
402 | printk(KERN_ERR PFX | 390 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
403 | "cannot register reboot notifier (err=%d)\n", rc); | ||
404 | goto err_out; | 391 | goto err_out; |
405 | } | 392 | } |
406 | 393 | ||
407 | rc = misc_register(&wdt_miscdev); | 394 | rc = misc_register(&wdt_miscdev); |
408 | if (rc) { | 395 | if (rc) { |
409 | printk(KERN_ERR PFX | 396 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
410 | "cannot register miscdev on minor=%d (err=%d)\n", | 397 | wdt_miscdev.minor, rc); |
411 | wdt_miscdev.minor, rc); | ||
412 | goto err_out_reboot; | 398 | goto err_out_reboot; |
413 | } | 399 | } |
414 | 400 | ||
415 | if (nowayout) | 401 | if (nowayout) |
416 | __module_get(THIS_MODULE); | 402 | __module_get(THIS_MODULE); |
417 | 403 | ||
418 | printk(KERN_INFO PFX "WDT driver for ALi M7101 initialised. " | 404 | pr_info("WDT driver for ALi M7101 initialised. timeout=%d sec (nowayout=%d)\n", |
419 | "timeout=%d sec (nowayout=%d)\n", | ||
420 | timeout, nowayout); | 405 | timeout, nowayout); |
421 | return 0; | 406 | return 0; |
422 | 407 | ||
diff --git a/drivers/watchdog/ar7_wdt.c b/drivers/watchdog/ar7_wdt.c index 502773ad5acd..2df16eb9d6dd 100644 --- a/drivers/watchdog/ar7_wdt.c +++ b/drivers/watchdog/ar7_wdt.c | |||
@@ -23,6 +23,8 @@ | |||
23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | 23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
27 | |||
26 | #include <linux/module.h> | 28 | #include <linux/module.h> |
27 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
28 | #include <linux/errno.h> | 30 | #include <linux/errno.h> |
@@ -39,7 +41,6 @@ | |||
39 | #include <asm/addrspace.h> | 41 | #include <asm/addrspace.h> |
40 | #include <asm/mach-ar7/ar7.h> | 42 | #include <asm/mach-ar7/ar7.h> |
41 | 43 | ||
42 | #define DRVNAME "ar7_wdt" | ||
43 | #define LONGNAME "TI AR7 Watchdog Timer" | 44 | #define LONGNAME "TI AR7 Watchdog Timer" |
44 | 45 | ||
45 | MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>"); | 46 | MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>"); |
@@ -93,7 +94,7 @@ static void ar7_wdt_kick(u32 value) | |||
93 | return; | 94 | return; |
94 | } | 95 | } |
95 | } | 96 | } |
96 | printk(KERN_ERR DRVNAME ": failed to unlock WDT kick reg\n"); | 97 | pr_err("failed to unlock WDT kick reg\n"); |
97 | } | 98 | } |
98 | 99 | ||
99 | static void ar7_wdt_prescale(u32 value) | 100 | static void ar7_wdt_prescale(u32 value) |
@@ -106,7 +107,7 @@ static void ar7_wdt_prescale(u32 value) | |||
106 | return; | 107 | return; |
107 | } | 108 | } |
108 | } | 109 | } |
109 | printk(KERN_ERR DRVNAME ": failed to unlock WDT prescale reg\n"); | 110 | pr_err("failed to unlock WDT prescale reg\n"); |
110 | } | 111 | } |
111 | 112 | ||
112 | static void ar7_wdt_change(u32 value) | 113 | static void ar7_wdt_change(u32 value) |
@@ -119,7 +120,7 @@ static void ar7_wdt_change(u32 value) | |||
119 | return; | 120 | return; |
120 | } | 121 | } |
121 | } | 122 | } |
122 | printk(KERN_ERR DRVNAME ": failed to unlock WDT change reg\n"); | 123 | pr_err("failed to unlock WDT change reg\n"); |
123 | } | 124 | } |
124 | 125 | ||
125 | static void ar7_wdt_disable(u32 value) | 126 | static void ar7_wdt_disable(u32 value) |
@@ -135,7 +136,7 @@ static void ar7_wdt_disable(u32 value) | |||
135 | } | 136 | } |
136 | } | 137 | } |
137 | } | 138 | } |
138 | printk(KERN_ERR DRVNAME ": failed to unlock WDT disable reg\n"); | 139 | pr_err("failed to unlock WDT disable reg\n"); |
139 | } | 140 | } |
140 | 141 | ||
141 | static void ar7_wdt_update_margin(int new_margin) | 142 | static void ar7_wdt_update_margin(int new_margin) |
@@ -151,21 +152,20 @@ static void ar7_wdt_update_margin(int new_margin) | |||
151 | change = 0xffff; | 152 | change = 0xffff; |
152 | ar7_wdt_change(change); | 153 | ar7_wdt_change(change); |
153 | margin = change * prescale_value / vbus_rate; | 154 | margin = change * prescale_value / vbus_rate; |
154 | printk(KERN_INFO DRVNAME | 155 | pr_info("timer margin %d seconds (prescale %d, change %d, freq %d)\n", |
155 | ": timer margin %d seconds (prescale %d, change %d, freq %d)\n", | 156 | margin, prescale_value, change, vbus_rate); |
156 | margin, prescale_value, change, vbus_rate); | ||
157 | } | 157 | } |
158 | 158 | ||
159 | static void ar7_wdt_enable_wdt(void) | 159 | static void ar7_wdt_enable_wdt(void) |
160 | { | 160 | { |
161 | printk(KERN_DEBUG DRVNAME ": enabling watchdog timer\n"); | 161 | pr_debug("enabling watchdog timer\n"); |
162 | ar7_wdt_disable(1); | 162 | ar7_wdt_disable(1); |
163 | ar7_wdt_kick(1); | 163 | ar7_wdt_kick(1); |
164 | } | 164 | } |
165 | 165 | ||
166 | static void ar7_wdt_disable_wdt(void) | 166 | static void ar7_wdt_disable_wdt(void) |
167 | { | 167 | { |
168 | printk(KERN_DEBUG DRVNAME ": disabling watchdog timer\n"); | 168 | pr_debug("disabling watchdog timer\n"); |
169 | ar7_wdt_disable(0); | 169 | ar7_wdt_disable(0); |
170 | } | 170 | } |
171 | 171 | ||
@@ -183,9 +183,7 @@ static int ar7_wdt_open(struct inode *inode, struct file *file) | |||
183 | static int ar7_wdt_release(struct inode *inode, struct file *file) | 183 | static int ar7_wdt_release(struct inode *inode, struct file *file) |
184 | { | 184 | { |
185 | if (!expect_close) | 185 | if (!expect_close) |
186 | printk(KERN_WARNING DRVNAME | 186 | pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n"); |
187 | ": watchdog device closed unexpectedly," | ||
188 | "will not disable the watchdog timer\n"); | ||
189 | else if (!nowayout) | 187 | else if (!nowayout) |
190 | ar7_wdt_disable_wdt(); | 188 | ar7_wdt_disable_wdt(); |
191 | clear_bit(0, &wdt_is_open); | 189 | clear_bit(0, &wdt_is_open); |
@@ -283,28 +281,28 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev) | |||
283 | ar7_regs_wdt = | 281 | ar7_regs_wdt = |
284 | platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); | 282 | platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); |
285 | if (!ar7_regs_wdt) { | 283 | if (!ar7_regs_wdt) { |
286 | printk(KERN_ERR DRVNAME ": could not get registers resource\n"); | 284 | pr_err("could not get registers resource\n"); |
287 | rc = -ENODEV; | 285 | rc = -ENODEV; |
288 | goto out; | 286 | goto out; |
289 | } | 287 | } |
290 | 288 | ||
291 | if (!request_mem_region(ar7_regs_wdt->start, | 289 | if (!request_mem_region(ar7_regs_wdt->start, |
292 | resource_size(ar7_regs_wdt), LONGNAME)) { | 290 | resource_size(ar7_regs_wdt), LONGNAME)) { |
293 | printk(KERN_WARNING DRVNAME ": watchdog I/O region busy\n"); | 291 | pr_warn("watchdog I/O region busy\n"); |
294 | rc = -EBUSY; | 292 | rc = -EBUSY; |
295 | goto out; | 293 | goto out; |
296 | } | 294 | } |
297 | 295 | ||
298 | ar7_wdt = ioremap(ar7_regs_wdt->start, resource_size(ar7_regs_wdt)); | 296 | ar7_wdt = ioremap(ar7_regs_wdt->start, resource_size(ar7_regs_wdt)); |
299 | if (!ar7_wdt) { | 297 | if (!ar7_wdt) { |
300 | printk(KERN_ERR DRVNAME ": could not ioremap registers\n"); | 298 | pr_err("could not ioremap registers\n"); |
301 | rc = -ENXIO; | 299 | rc = -ENXIO; |
302 | goto out_mem_region; | 300 | goto out_mem_region; |
303 | } | 301 | } |
304 | 302 | ||
305 | vbus_clk = clk_get(NULL, "vbus"); | 303 | vbus_clk = clk_get(NULL, "vbus"); |
306 | if (IS_ERR(vbus_clk)) { | 304 | if (IS_ERR(vbus_clk)) { |
307 | printk(KERN_ERR DRVNAME ": could not get vbus clock\n"); | 305 | pr_err("could not get vbus clock\n"); |
308 | rc = PTR_ERR(vbus_clk); | 306 | rc = PTR_ERR(vbus_clk); |
309 | goto out_mem_region; | 307 | goto out_mem_region; |
310 | } | 308 | } |
@@ -315,7 +313,7 @@ static int __devinit ar7_wdt_probe(struct platform_device *pdev) | |||
315 | 313 | ||
316 | rc = misc_register(&ar7_wdt_miscdev); | 314 | rc = misc_register(&ar7_wdt_miscdev); |
317 | if (rc) { | 315 | if (rc) { |
318 | printk(KERN_ERR DRVNAME ": unable to register misc device\n"); | 316 | pr_err("unable to register misc device\n"); |
319 | goto out_alloc; | 317 | goto out_alloc; |
320 | } | 318 | } |
321 | goto out; | 319 | goto out; |
diff --git a/drivers/watchdog/at91rm9200_wdt.c b/drivers/watchdog/at91rm9200_wdt.c index b3046dc4b56c..3ecd246d2cfd 100644 --- a/drivers/watchdog/at91rm9200_wdt.c +++ b/drivers/watchdog/at91rm9200_wdt.c | |||
@@ -9,6 +9,8 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
13 | |||
12 | #include <linux/bitops.h> | 14 | #include <linux/bitops.h> |
13 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
14 | #include <linux/fs.h> | 16 | #include <linux/fs.h> |
@@ -209,8 +211,8 @@ static int __devinit at91wdt_probe(struct platform_device *pdev) | |||
209 | if (res) | 211 | if (res) |
210 | return res; | 212 | return res; |
211 | 213 | ||
212 | printk(KERN_INFO "AT91 Watchdog Timer enabled (%d seconds%s)\n", | 214 | pr_info("AT91 Watchdog Timer enabled (%d seconds%s)\n", |
213 | wdt_time, nowayout ? ", nowayout" : ""); | 215 | wdt_time, nowayout ? ", nowayout" : ""); |
214 | return 0; | 216 | return 0; |
215 | } | 217 | } |
216 | 218 | ||
@@ -268,8 +270,8 @@ static int __init at91_wdt_init(void) | |||
268 | if not reset to the default */ | 270 | if not reset to the default */ |
269 | if (at91_wdt_settimeout(wdt_time)) { | 271 | if (at91_wdt_settimeout(wdt_time)) { |
270 | at91_wdt_settimeout(WDT_DEFAULT_TIME); | 272 | at91_wdt_settimeout(WDT_DEFAULT_TIME); |
271 | pr_info("at91_wdt: wdt_time value must be 1 <= wdt_time <= 256" | 273 | pr_info("wdt_time value must be 1 <= wdt_time <= 256, using %d\n", |
272 | ", using %d\n", wdt_time); | 274 | wdt_time); |
273 | } | 275 | } |
274 | 276 | ||
275 | return platform_driver_register(&at91wdt_driver); | 277 | return platform_driver_register(&at91wdt_driver); |
diff --git a/drivers/watchdog/at91sam9_wdt.c b/drivers/watchdog/at91sam9_wdt.c index 00562566ef5f..cf39847bbad3 100644 --- a/drivers/watchdog/at91sam9_wdt.c +++ b/drivers/watchdog/at91sam9_wdt.c | |||
@@ -15,6 +15,8 @@ | |||
15 | * bootloader doesn't write to this register. | 15 | * bootloader doesn't write to this register. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
19 | |||
18 | #include <linux/errno.h> | 20 | #include <linux/errno.h> |
19 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
20 | #include <linux/init.h> | 22 | #include <linux/init.h> |
@@ -96,7 +98,7 @@ static void at91_ping(unsigned long data) | |||
96 | at91_wdt_reset(); | 98 | at91_wdt_reset(); |
97 | mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT); | 99 | mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT); |
98 | } else | 100 | } else |
99 | printk(KERN_CRIT DRV_NAME": I will reset your machine !\n"); | 101 | pr_crit("I will reset your machine !\n"); |
100 | } | 102 | } |
101 | 103 | ||
102 | /* | 104 | /* |
@@ -140,7 +142,7 @@ static int at91_wdt_settimeout(unsigned int timeout) | |||
140 | /* Check if disabled */ | 142 | /* Check if disabled */ |
141 | mr = wdt_read(AT91_WDT_MR); | 143 | mr = wdt_read(AT91_WDT_MR); |
142 | if (mr & AT91_WDT_WDDIS) { | 144 | if (mr & AT91_WDT_WDDIS) { |
143 | printk(KERN_ERR DRV_NAME": sorry, watchdog is disabled\n"); | 145 | pr_err("sorry, watchdog is disabled\n"); |
144 | return -EIO; | 146 | return -EIO; |
145 | } | 147 | } |
146 | 148 | ||
@@ -283,7 +285,7 @@ static int __init at91wdt_probe(struct platform_device *pdev) | |||
283 | setup_timer(&at91wdt_private.timer, at91_ping, 0); | 285 | setup_timer(&at91wdt_private.timer, at91_ping, 0); |
284 | mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT); | 286 | mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT); |
285 | 287 | ||
286 | printk(KERN_INFO DRV_NAME " enabled (heartbeat=%d sec, nowayout=%d)\n", | 288 | pr_info("enabled (heartbeat=%d sec, nowayout=%d)\n", |
287 | heartbeat, nowayout); | 289 | heartbeat, nowayout); |
288 | 290 | ||
289 | return 0; | 291 | return 0; |
diff --git a/drivers/watchdog/ath79_wdt.c b/drivers/watchdog/ath79_wdt.c index 9db808349f8b..3bb49fd8d384 100644 --- a/drivers/watchdog/ath79_wdt.c +++ b/drivers/watchdog/ath79_wdt.c | |||
@@ -17,6 +17,8 @@ | |||
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | #include <linux/bitops.h> | 22 | #include <linux/bitops.h> |
21 | #include <linux/errno.h> | 23 | #include <linux/errno.h> |
22 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
@@ -114,8 +116,7 @@ static int ath79_wdt_release(struct inode *inode, struct file *file) | |||
114 | if (test_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags)) | 116 | if (test_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags)) |
115 | ath79_wdt_disable(); | 117 | ath79_wdt_disable(); |
116 | else { | 118 | else { |
117 | pr_crit(DRIVER_NAME ": device closed unexpectedly, " | 119 | pr_crit("device closed unexpectedly, watchdog timer will not stop!\n"); |
118 | "watchdog timer will not stop!\n"); | ||
119 | ath79_wdt_keepalive(); | 120 | ath79_wdt_keepalive(); |
120 | } | 121 | } |
121 | 122 | ||
diff --git a/drivers/watchdog/bcm47xx_wdt.c b/drivers/watchdog/bcm47xx_wdt.c index 5c5f4b14fd05..1989e179db17 100644 --- a/drivers/watchdog/bcm47xx_wdt.c +++ b/drivers/watchdog/bcm47xx_wdt.c | |||
@@ -10,6 +10,8 @@ | |||
10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
14 | |||
13 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
14 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
15 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
@@ -91,7 +93,7 @@ static void bcm47xx_timer_tick(unsigned long unused) | |||
91 | bcm47xx_wdt_hw_start(); | 93 | bcm47xx_wdt_hw_start(); |
92 | mod_timer(&wdt_timer, jiffies + HZ); | 94 | mod_timer(&wdt_timer, jiffies + HZ); |
93 | } else { | 95 | } else { |
94 | printk(KERN_CRIT DRV_NAME "Watchdog will fire soon!!!\n"); | 96 | pr_crit("Watchdog will fire soon!!!\n"); |
95 | } | 97 | } |
96 | } | 98 | } |
97 | 99 | ||
@@ -140,8 +142,7 @@ static int bcm47xx_wdt_release(struct inode *inode, struct file *file) | |||
140 | if (expect_release == 42) { | 142 | if (expect_release == 42) { |
141 | bcm47xx_wdt_stop(); | 143 | bcm47xx_wdt_stop(); |
142 | } else { | 144 | } else { |
143 | printk(KERN_CRIT DRV_NAME | 145 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
144 | ": Unexpected close, not stopping watchdog!\n"); | ||
145 | bcm47xx_wdt_start(); | 146 | bcm47xx_wdt_start(); |
146 | } | 147 | } |
147 | 148 | ||
@@ -270,8 +271,7 @@ static int __init bcm47xx_wdt_init(void) | |||
270 | 271 | ||
271 | if (bcm47xx_wdt_settimeout(wdt_time)) { | 272 | if (bcm47xx_wdt_settimeout(wdt_time)) { |
272 | bcm47xx_wdt_settimeout(WDT_DEFAULT_TIME); | 273 | bcm47xx_wdt_settimeout(WDT_DEFAULT_TIME); |
273 | printk(KERN_INFO DRV_NAME ": " | 274 | pr_info("wdt_time value must be 0 < wdt_time < %d, using %d\n", |
274 | "wdt_time value must be 0 < wdt_time < %d, using %d\n", | ||
275 | (WDT_MAX_TIME + 1), wdt_time); | 275 | (WDT_MAX_TIME + 1), wdt_time); |
276 | } | 276 | } |
277 | 277 | ||
@@ -285,8 +285,8 @@ static int __init bcm47xx_wdt_init(void) | |||
285 | return ret; | 285 | return ret; |
286 | } | 286 | } |
287 | 287 | ||
288 | printk(KERN_INFO "BCM47xx Watchdog Timer enabled (%d seconds%s)\n", | 288 | pr_info("BCM47xx Watchdog Timer enabled (%d seconds%s)\n", |
289 | wdt_time, nowayout ? ", nowayout" : ""); | 289 | wdt_time, nowayout ? ", nowayout" : ""); |
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
292 | 292 | ||
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index 8dc7de641e26..af95b386d8f5 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c | |||
@@ -10,6 +10,8 @@ | |||
10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
14 | |||
13 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
14 | #include <linux/errno.h> | 16 | #include <linux/errno.h> |
15 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
@@ -82,7 +84,7 @@ static void bcm63xx_timer_tick(unsigned long unused) | |||
82 | bcm63xx_wdt_hw_start(); | 84 | bcm63xx_wdt_hw_start(); |
83 | mod_timer(&bcm63xx_wdt_device.timer, jiffies + HZ); | 85 | mod_timer(&bcm63xx_wdt_device.timer, jiffies + HZ); |
84 | } else | 86 | } else |
85 | printk(KERN_CRIT PFX ": watchdog will restart system\n"); | 87 | pr_crit("watchdog will restart system\n"); |
86 | } | 88 | } |
87 | 89 | ||
88 | static void bcm63xx_wdt_pet(void) | 90 | static void bcm63xx_wdt_pet(void) |
@@ -126,8 +128,7 @@ static int bcm63xx_wdt_release(struct inode *inode, struct file *file) | |||
126 | if (expect_close == 42) | 128 | if (expect_close == 42) |
127 | bcm63xx_wdt_pause(); | 129 | bcm63xx_wdt_pause(); |
128 | else { | 130 | else { |
129 | printk(KERN_CRIT PFX | 131 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
130 | ": Unexpected close, not stopping watchdog!\n"); | ||
131 | bcm63xx_wdt_start(); | 132 | bcm63xx_wdt_start(); |
132 | } | 133 | } |
133 | clear_bit(0, &bcm63xx_wdt_device.inuse); | 134 | clear_bit(0, &bcm63xx_wdt_device.inuse); |
diff --git a/drivers/watchdog/bfin_wdt.c b/drivers/watchdog/bfin_wdt.c index b9fa9b71583a..402e9ccea395 100644 --- a/drivers/watchdog/bfin_wdt.c +++ b/drivers/watchdog/bfin_wdt.c | |||
@@ -11,6 +11,8 @@ | |||
11 | * Licensed under the GPL-2 or later. | 11 | * Licensed under the GPL-2 or later. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
14 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
15 | #include <linux/module.h> | 17 | #include <linux/module.h> |
16 | #include <linux/moduleparam.h> | 18 | #include <linux/moduleparam.h> |
@@ -28,15 +30,8 @@ | |||
28 | #define stamp(fmt, args...) \ | 30 | #define stamp(fmt, args...) \ |
29 | pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args) | 31 | pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args) |
30 | #define stampit() stamp("here i am") | 32 | #define stampit() stamp("here i am") |
31 | #define pr_devinit(fmt, args...) \ | ||
32 | ({ static const __devinitconst char __fmt[] = fmt; \ | ||
33 | printk(__fmt, ## args); }) | ||
34 | #define pr_init(fmt, args...) \ | ||
35 | ({ static const __initconst char __fmt[] = fmt; \ | ||
36 | printk(__fmt, ## args); }) | ||
37 | 33 | ||
38 | #define WATCHDOG_NAME "bfin-wdt" | 34 | #define WATCHDOG_NAME "bfin-wdt" |
39 | #define PFX WATCHDOG_NAME ": " | ||
40 | 35 | ||
41 | /* The BF561 has two watchdogs (one per core), but since Linux | 36 | /* The BF561 has two watchdogs (one per core), but since Linux |
42 | * only runs on core A, we'll just work with that one. | 37 | * only runs on core A, we'll just work with that one. |
@@ -126,7 +121,7 @@ static int bfin_wdt_set_timeout(unsigned long t) | |||
126 | stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt); | 121 | stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt); |
127 | 122 | ||
128 | if (t > max_t) { | 123 | if (t > max_t) { |
129 | printk(KERN_WARNING PFX "timeout value is too large\n"); | 124 | pr_warn("timeout value is too large\n"); |
130 | return -EINVAL; | 125 | return -EINVAL; |
131 | } | 126 | } |
132 | 127 | ||
@@ -182,8 +177,7 @@ static int bfin_wdt_release(struct inode *inode, struct file *file) | |||
182 | if (expect_close == 42) | 177 | if (expect_close == 42) |
183 | bfin_wdt_stop(); | 178 | bfin_wdt_stop(); |
184 | else { | 179 | else { |
185 | printk(KERN_CRIT PFX | 180 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
186 | "Unexpected close, not stopping watchdog!\n"); | ||
187 | bfin_wdt_keepalive(); | 181 | bfin_wdt_keepalive(); |
188 | } | 182 | } |
189 | expect_close = 0; | 183 | expect_close = 0; |
@@ -368,14 +362,13 @@ static int __devinit bfin_wdt_probe(struct platform_device *pdev) | |||
368 | 362 | ||
369 | ret = misc_register(&bfin_wdt_miscdev); | 363 | ret = misc_register(&bfin_wdt_miscdev); |
370 | if (ret) { | 364 | if (ret) { |
371 | pr_devinit(KERN_ERR PFX | 365 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
372 | "cannot register miscdev on minor=%d (err=%d)\n", | 366 | WATCHDOG_MINOR, ret); |
373 | WATCHDOG_MINOR, ret); | ||
374 | return ret; | 367 | return ret; |
375 | } | 368 | } |
376 | 369 | ||
377 | pr_devinit(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n", | 370 | pr_info("initialized: timeout=%d sec (nowayout=%d)\n", |
378 | timeout, nowayout); | 371 | timeout, nowayout); |
379 | 372 | ||
380 | return 0; | 373 | return 0; |
381 | } | 374 | } |
@@ -439,14 +432,14 @@ static int __init bfin_wdt_init(void) | |||
439 | */ | 432 | */ |
440 | ret = platform_driver_register(&bfin_wdt_driver); | 433 | ret = platform_driver_register(&bfin_wdt_driver); |
441 | if (ret) { | 434 | if (ret) { |
442 | pr_init(KERN_ERR PFX "unable to register driver\n"); | 435 | pr_err("unable to register driver\n"); |
443 | return ret; | 436 | return ret; |
444 | } | 437 | } |
445 | 438 | ||
446 | bfin_wdt_device = platform_device_register_simple(WATCHDOG_NAME, | 439 | bfin_wdt_device = platform_device_register_simple(WATCHDOG_NAME, |
447 | -1, NULL, 0); | 440 | -1, NULL, 0); |
448 | if (IS_ERR(bfin_wdt_device)) { | 441 | if (IS_ERR(bfin_wdt_device)) { |
449 | pr_init(KERN_ERR PFX "unable to register device\n"); | 442 | pr_err("unable to register device\n"); |
450 | platform_driver_unregister(&bfin_wdt_driver); | 443 | platform_driver_unregister(&bfin_wdt_driver); |
451 | return PTR_ERR(bfin_wdt_device); | 444 | return PTR_ERR(bfin_wdt_device); |
452 | } | 445 | } |
diff --git a/drivers/watchdog/booke_wdt.c b/drivers/watchdog/booke_wdt.c index 7c0fdfca2646..3990d82f935c 100644 --- a/drivers/watchdog/booke_wdt.c +++ b/drivers/watchdog/booke_wdt.c | |||
@@ -12,6 +12,8 @@ | |||
12 | * option) any later version. | 12 | * option) any later version. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
16 | |||
15 | #include <linux/module.h> | 17 | #include <linux/module.h> |
16 | #include <linux/fs.h> | 18 | #include <linux/fs.h> |
17 | #include <linux/smp.h> | 19 | #include <linux/smp.h> |
@@ -225,8 +227,8 @@ static int booke_wdt_open(struct inode *inode, struct file *file) | |||
225 | if (booke_wdt_enabled == 0) { | 227 | if (booke_wdt_enabled == 0) { |
226 | booke_wdt_enabled = 1; | 228 | booke_wdt_enabled = 1; |
227 | on_each_cpu(__booke_wdt_enable, NULL, 0); | 229 | on_each_cpu(__booke_wdt_enable, NULL, 0); |
228 | pr_debug("booke_wdt: watchdog enabled (timeout = %llu sec)\n", | 230 | pr_debug("watchdog enabled (timeout = %llu sec)\n", |
229 | period_to_sec(booke_wdt_period)); | 231 | period_to_sec(booke_wdt_period)); |
230 | } | 232 | } |
231 | spin_unlock(&booke_wdt_lock); | 233 | spin_unlock(&booke_wdt_lock); |
232 | 234 | ||
@@ -243,7 +245,7 @@ static int booke_wdt_release(struct inode *inode, struct file *file) | |||
243 | */ | 245 | */ |
244 | on_each_cpu(__booke_wdt_disable, NULL, 0); | 246 | on_each_cpu(__booke_wdt_disable, NULL, 0); |
245 | booke_wdt_enabled = 0; | 247 | booke_wdt_enabled = 0; |
246 | pr_debug("booke_wdt: watchdog disabled\n"); | 248 | pr_debug("watchdog disabled\n"); |
247 | #endif | 249 | #endif |
248 | 250 | ||
249 | clear_bit(0, &wdt_is_active); | 251 | clear_bit(0, &wdt_is_active); |
@@ -275,19 +277,19 @@ static int __init booke_wdt_init(void) | |||
275 | { | 277 | { |
276 | int ret = 0; | 278 | int ret = 0; |
277 | 279 | ||
278 | pr_info("booke_wdt: powerpc book-e watchdog driver loaded\n"); | 280 | pr_info("powerpc book-e watchdog driver loaded\n"); |
279 | ident.firmware_version = cur_cpu_spec->pvr_value; | 281 | ident.firmware_version = cur_cpu_spec->pvr_value; |
280 | 282 | ||
281 | ret = misc_register(&booke_wdt_miscdev); | 283 | ret = misc_register(&booke_wdt_miscdev); |
282 | if (ret) { | 284 | if (ret) { |
283 | pr_err("booke_wdt: cannot register device (minor=%u, ret=%i)\n", | 285 | pr_err("cannot register device (minor=%u, ret=%i)\n", |
284 | WATCHDOG_MINOR, ret); | 286 | WATCHDOG_MINOR, ret); |
285 | return ret; | 287 | return ret; |
286 | } | 288 | } |
287 | 289 | ||
288 | spin_lock(&booke_wdt_lock); | 290 | spin_lock(&booke_wdt_lock); |
289 | if (booke_wdt_enabled == 1) { | 291 | if (booke_wdt_enabled == 1) { |
290 | pr_info("booke_wdt: watchdog enabled (timeout = %llu sec)\n", | 292 | pr_info("watchdog enabled (timeout = %llu sec)\n", |
291 | period_to_sec(booke_wdt_period)); | 293 | period_to_sec(booke_wdt_period)); |
292 | on_each_cpu(__booke_wdt_enable, NULL, 0); | 294 | on_each_cpu(__booke_wdt_enable, NULL, 0); |
293 | } | 295 | } |
diff --git a/drivers/watchdog/cpu5wdt.c b/drivers/watchdog/cpu5wdt.c index 251c863d71dd..7e888393de1f 100644 --- a/drivers/watchdog/cpu5wdt.c +++ b/drivers/watchdog/cpu5wdt.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * | 19 | * |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #include <linux/module.h> | 24 | #include <linux/module.h> |
23 | #include <linux/moduleparam.h> | 25 | #include <linux/moduleparam.h> |
24 | #include <linux/types.h> | 26 | #include <linux/types.h> |
@@ -71,7 +73,7 @@ static struct { | |||
71 | static void cpu5wdt_trigger(unsigned long unused) | 73 | static void cpu5wdt_trigger(unsigned long unused) |
72 | { | 74 | { |
73 | if (verbose > 2) | 75 | if (verbose > 2) |
74 | printk(KERN_DEBUG PFX "trigger at %i ticks\n", ticks); | 76 | pr_debug("trigger at %i ticks\n", ticks); |
75 | 77 | ||
76 | if (cpu5wdt_device.running) | 78 | if (cpu5wdt_device.running) |
77 | ticks--; | 79 | ticks--; |
@@ -96,7 +98,7 @@ static void cpu5wdt_reset(void) | |||
96 | ticks = cpu5wdt_device.default_ticks; | 98 | ticks = cpu5wdt_device.default_ticks; |
97 | 99 | ||
98 | if (verbose) | 100 | if (verbose) |
99 | printk(KERN_DEBUG PFX "reset (%i ticks)\n", (int) ticks); | 101 | pr_debug("reset (%i ticks)\n", (int) ticks); |
100 | 102 | ||
101 | } | 103 | } |
102 | 104 | ||
@@ -129,7 +131,7 @@ static int cpu5wdt_stop(void) | |||
129 | ticks = cpu5wdt_device.default_ticks; | 131 | ticks = cpu5wdt_device.default_ticks; |
130 | spin_unlock_irqrestore(&cpu5wdt_lock, flags); | 132 | spin_unlock_irqrestore(&cpu5wdt_lock, flags); |
131 | if (verbose) | 133 | if (verbose) |
132 | printk(KERN_CRIT PFX "stop not possible\n"); | 134 | pr_crit("stop not possible\n"); |
133 | return -EIO; | 135 | return -EIO; |
134 | } | 136 | } |
135 | 137 | ||
@@ -219,8 +221,7 @@ static int __devinit cpu5wdt_init(void) | |||
219 | int err; | 221 | int err; |
220 | 222 | ||
221 | if (verbose) | 223 | if (verbose) |
222 | printk(KERN_DEBUG PFX | 224 | pr_debug("port=0x%x, verbose=%i\n", port, verbose); |
223 | "port=0x%x, verbose=%i\n", port, verbose); | ||
224 | 225 | ||
225 | init_completion(&cpu5wdt_device.stop); | 226 | init_completion(&cpu5wdt_device.stop); |
226 | cpu5wdt_device.queue = 0; | 227 | cpu5wdt_device.queue = 0; |
@@ -228,7 +229,7 @@ static int __devinit cpu5wdt_init(void) | |||
228 | cpu5wdt_device.default_ticks = ticks; | 229 | cpu5wdt_device.default_ticks = ticks; |
229 | 230 | ||
230 | if (!request_region(port, CPU5WDT_EXTENT, PFX)) { | 231 | if (!request_region(port, CPU5WDT_EXTENT, PFX)) { |
231 | printk(KERN_ERR PFX "request_region failed\n"); | 232 | pr_err("request_region failed\n"); |
232 | err = -EBUSY; | 233 | err = -EBUSY; |
233 | goto no_port; | 234 | goto no_port; |
234 | } | 235 | } |
@@ -237,16 +238,16 @@ static int __devinit cpu5wdt_init(void) | |||
237 | val = inb(port + CPU5WDT_STATUS_REG); | 238 | val = inb(port + CPU5WDT_STATUS_REG); |
238 | val = (val >> 2) & 1; | 239 | val = (val >> 2) & 1; |
239 | if (!val) | 240 | if (!val) |
240 | printk(KERN_INFO PFX "sorry, was my fault\n"); | 241 | pr_info("sorry, was my fault\n"); |
241 | 242 | ||
242 | err = misc_register(&cpu5wdt_misc); | 243 | err = misc_register(&cpu5wdt_misc); |
243 | if (err < 0) { | 244 | if (err < 0) { |
244 | printk(KERN_ERR PFX "misc_register failed\n"); | 245 | pr_err("misc_register failed\n"); |
245 | goto no_misc; | 246 | goto no_misc; |
246 | } | 247 | } |
247 | 248 | ||
248 | 249 | ||
249 | printk(KERN_INFO PFX "init success\n"); | 250 | pr_info("init success\n"); |
250 | return 0; | 251 | return 0; |
251 | 252 | ||
252 | no_misc: | 253 | no_misc: |
diff --git a/drivers/watchdog/cpwd.c b/drivers/watchdog/cpwd.c index 1b793dfd868f..95b1b954de1b 100644 --- a/drivers/watchdog/cpwd.c +++ b/drivers/watchdog/cpwd.c | |||
@@ -14,6 +14,8 @@ | |||
14 | * Copyright (C) 2008 David S. Miller <davem@davemloft.net> | 14 | * Copyright (C) 2008 David S. Miller <davem@davemloft.net> |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
18 | |||
17 | #include <linux/kernel.h> | 19 | #include <linux/kernel.h> |
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
19 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
@@ -35,7 +37,6 @@ | |||
35 | #include <asm/watchdog.h> | 37 | #include <asm/watchdog.h> |
36 | 38 | ||
37 | #define DRIVER_NAME "cpwd" | 39 | #define DRIVER_NAME "cpwd" |
38 | #define PFX DRIVER_NAME ": " | ||
39 | 40 | ||
40 | #define WD_OBPNAME "watchdog" | 41 | #define WD_OBPNAME "watchdog" |
41 | #define WD_BADMODEL "SUNW,501-5336" | 42 | #define WD_BADMODEL "SUNW,501-5336" |
@@ -385,8 +386,7 @@ static int cpwd_open(struct inode *inode, struct file *f) | |||
385 | if (!p->initialized) { | 386 | if (!p->initialized) { |
386 | if (request_irq(p->irq, &cpwd_interrupt, | 387 | if (request_irq(p->irq, &cpwd_interrupt, |
387 | IRQF_SHARED, DRIVER_NAME, p)) { | 388 | IRQF_SHARED, DRIVER_NAME, p)) { |
388 | printk(KERN_ERR PFX "Cannot register IRQ %d\n", | 389 | pr_err("Cannot register IRQ %d\n", p->irq); |
389 | p->irq); | ||
390 | mutex_unlock(&cpwd_mutex); | 390 | mutex_unlock(&cpwd_mutex); |
391 | return -EBUSY; | 391 | return -EBUSY; |
392 | } | 392 | } |
@@ -542,7 +542,7 @@ static int __devinit cpwd_probe(struct platform_device *op) | |||
542 | p = kzalloc(sizeof(*p), GFP_KERNEL); | 542 | p = kzalloc(sizeof(*p), GFP_KERNEL); |
543 | err = -ENOMEM; | 543 | err = -ENOMEM; |
544 | if (!p) { | 544 | if (!p) { |
545 | printk(KERN_ERR PFX "Unable to allocate struct cpwd.\n"); | 545 | pr_err("Unable to allocate struct cpwd\n"); |
546 | goto out; | 546 | goto out; |
547 | } | 547 | } |
548 | 548 | ||
@@ -553,14 +553,14 @@ static int __devinit cpwd_probe(struct platform_device *op) | |||
553 | p->regs = of_ioremap(&op->resource[0], 0, | 553 | p->regs = of_ioremap(&op->resource[0], 0, |
554 | 4 * WD_TIMER_REGSZ, DRIVER_NAME); | 554 | 4 * WD_TIMER_REGSZ, DRIVER_NAME); |
555 | if (!p->regs) { | 555 | if (!p->regs) { |
556 | printk(KERN_ERR PFX "Unable to map registers.\n"); | 556 | pr_err("Unable to map registers\n"); |
557 | goto out_free; | 557 | goto out_free; |
558 | } | 558 | } |
559 | 559 | ||
560 | options = of_find_node_by_path("/options"); | 560 | options = of_find_node_by_path("/options"); |
561 | err = -ENODEV; | 561 | err = -ENODEV; |
562 | if (!options) { | 562 | if (!options) { |
563 | printk(KERN_ERR PFX "Unable to find /options node.\n"); | 563 | pr_err("Unable to find /options node\n"); |
564 | goto out_iounmap; | 564 | goto out_iounmap; |
565 | } | 565 | } |
566 | 566 | ||
@@ -605,8 +605,8 @@ static int __devinit cpwd_probe(struct platform_device *op) | |||
605 | 605 | ||
606 | err = misc_register(&p->devs[i].misc); | 606 | err = misc_register(&p->devs[i].misc); |
607 | if (err) { | 607 | if (err) { |
608 | printk(KERN_ERR "Could not register misc device for " | 608 | pr_err("Could not register misc device for dev %d\n", |
609 | "dev %d\n", i); | 609 | i); |
610 | goto out_unregister; | 610 | goto out_unregister; |
611 | } | 611 | } |
612 | } | 612 | } |
@@ -617,8 +617,8 @@ static int __devinit cpwd_probe(struct platform_device *op) | |||
617 | cpwd_timer.data = (unsigned long) p; | 617 | cpwd_timer.data = (unsigned long) p; |
618 | cpwd_timer.expires = WD_BTIMEOUT; | 618 | cpwd_timer.expires = WD_BTIMEOUT; |
619 | 619 | ||
620 | printk(KERN_INFO PFX "PLD defect workaround enabled for " | 620 | pr_info("PLD defect workaround enabled for model %s\n", |
621 | "model " WD_BADMODEL ".\n"); | 621 | WD_BADMODEL); |
622 | } | 622 | } |
623 | 623 | ||
624 | dev_set_drvdata(&op->dev, p); | 624 | dev_set_drvdata(&op->dev, p); |
diff --git a/drivers/watchdog/dw_wdt.c b/drivers/watchdog/dw_wdt.c index 63d7b58f1c7d..78a6827f7de6 100644 --- a/drivers/watchdog/dw_wdt.c +++ b/drivers/watchdog/dw_wdt.c | |||
@@ -16,7 +16,8 @@ | |||
16 | * If we receive an expected close for the watchdog then we keep the timer | 16 | * If we receive an expected close for the watchdog then we keep the timer |
17 | * running, otherwise the timer is stopped and the watchdog will expire. | 17 | * running, otherwise the timer is stopped and the watchdog will expire. |
18 | */ | 18 | */ |
19 | #define pr_fmt(fmt) "dw_wdt: " fmt | 19 | |
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
20 | 21 | ||
21 | #include <linux/bitops.h> | 22 | #include <linux/bitops.h> |
22 | #include <linux/clk.h> | 23 | #include <linux/clk.h> |
diff --git a/drivers/watchdog/ep93xx_wdt.c b/drivers/watchdog/ep93xx_wdt.c index 726b7df61fd0..a6532b52c457 100644 --- a/drivers/watchdog/ep93xx_wdt.c +++ b/drivers/watchdog/ep93xx_wdt.c | |||
@@ -23,6 +23,8 @@ | |||
23 | * - Add a few missing ioctls | 23 | * - Add a few missing ioctls |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
27 | |||
26 | #include <linux/module.h> | 28 | #include <linux/module.h> |
27 | #include <linux/fs.h> | 29 | #include <linux/fs.h> |
28 | #include <linux/miscdevice.h> | 30 | #include <linux/miscdevice.h> |
@@ -33,7 +35,6 @@ | |||
33 | #include <mach/hardware.h> | 35 | #include <mach/hardware.h> |
34 | 36 | ||
35 | #define WDT_VERSION "0.3" | 37 | #define WDT_VERSION "0.3" |
36 | #define PFX "ep93xx_wdt: " | ||
37 | 38 | ||
38 | /* default timeout (secs) */ | 39 | /* default timeout (secs) */ |
39 | #define WDT_TIMEOUT 30 | 40 | #define WDT_TIMEOUT 30 |
@@ -173,8 +174,7 @@ static int ep93xx_wdt_release(struct inode *inode, struct file *file) | |||
173 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) | 174 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) |
174 | wdt_shutdown(); | 175 | wdt_shutdown(); |
175 | else | 176 | else |
176 | printk(KERN_CRIT PFX | 177 | pr_crit("Device closed unexpectedly - timer will not stop\n"); |
177 | "Device closed unexpectedly - timer will not stop\n"); | ||
178 | 178 | ||
179 | clear_bit(WDT_IN_USE, &wdt_status); | 179 | clear_bit(WDT_IN_USE, &wdt_status); |
180 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); | 180 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); |
@@ -214,15 +214,13 @@ static int __init ep93xx_wdt_init(void) | |||
214 | 214 | ||
215 | boot_status = __raw_readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0; | 215 | boot_status = __raw_readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0; |
216 | 216 | ||
217 | printk(KERN_INFO PFX "EP93XX watchdog, driver version " | 217 | pr_info("EP93XX watchdog, driver version " WDT_VERSION "%s\n", |
218 | WDT_VERSION "%s\n", | ||
219 | (__raw_readl(EP93XX_WDT_WATCHDOG) & 0x08) | 218 | (__raw_readl(EP93XX_WDT_WATCHDOG) & 0x08) |
220 | ? " (nCS1 disable detected)" : ""); | 219 | ? " (nCS1 disable detected)" : ""); |
221 | 220 | ||
222 | if (timeout < 1 || timeout > 3600) { | 221 | if (timeout < 1 || timeout > 3600) { |
223 | timeout = WDT_TIMEOUT; | 222 | timeout = WDT_TIMEOUT; |
224 | printk(KERN_INFO PFX | 223 | pr_info("timeout value must be 1<=x<=3600, using %d\n", |
225 | "timeout value must be 1<=x<=3600, using %d\n", | ||
226 | timeout); | 224 | timeout); |
227 | } | 225 | } |
228 | 226 | ||
diff --git a/drivers/watchdog/eurotechwdt.c b/drivers/watchdog/eurotechwdt.c index 3946c51099c0..22d967a5ac8c 100644 --- a/drivers/watchdog/eurotechwdt.c +++ b/drivers/watchdog/eurotechwdt.c | |||
@@ -45,6 +45,8 @@ | |||
45 | * of the on-board SUPER I/O device SMSC FDC 37B782. | 45 | * of the on-board SUPER I/O device SMSC FDC 37B782. |
46 | */ | 46 | */ |
47 | 47 | ||
48 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
49 | |||
48 | #include <linux/interrupt.h> | 50 | #include <linux/interrupt.h> |
49 | #include <linux/module.h> | 51 | #include <linux/module.h> |
50 | #include <linux/moduleparam.h> | 52 | #include <linux/moduleparam.h> |
@@ -144,11 +146,11 @@ static void eurwdt_activate_timer(void) | |||
144 | 146 | ||
145 | /* Setting interrupt line */ | 147 | /* Setting interrupt line */ |
146 | if (irq == 2 || irq > 15 || irq < 0) { | 148 | if (irq == 2 || irq > 15 || irq < 0) { |
147 | printk(KERN_ERR ": invalid irq number\n"); | 149 | pr_err("invalid irq number\n"); |
148 | irq = 0; /* if invalid we disable interrupt */ | 150 | irq = 0; /* if invalid we disable interrupt */ |
149 | } | 151 | } |
150 | if (irq == 0) | 152 | if (irq == 0) |
151 | printk(KERN_INFO ": interrupt disabled\n"); | 153 | pr_info("interrupt disabled\n"); |
152 | 154 | ||
153 | eurwdt_write_reg(WDT_TIMER_CFG, irq << 4); | 155 | eurwdt_write_reg(WDT_TIMER_CFG, irq << 4); |
154 | 156 | ||
@@ -163,12 +165,12 @@ static void eurwdt_activate_timer(void) | |||
163 | 165 | ||
164 | static irqreturn_t eurwdt_interrupt(int irq, void *dev_id) | 166 | static irqreturn_t eurwdt_interrupt(int irq, void *dev_id) |
165 | { | 167 | { |
166 | printk(KERN_CRIT "timeout WDT timeout\n"); | 168 | pr_crit("timeout WDT timeout\n"); |
167 | 169 | ||
168 | #ifdef ONLY_TESTING | 170 | #ifdef ONLY_TESTING |
169 | printk(KERN_CRIT "Would Reboot.\n"); | 171 | pr_crit("Would Reboot\n"); |
170 | #else | 172 | #else |
171 | printk(KERN_CRIT "Initiating system reboot.\n"); | 173 | pr_crit("Initiating system reboot\n"); |
172 | emergency_restart(); | 174 | emergency_restart(); |
173 | #endif | 175 | #endif |
174 | return IRQ_HANDLED; | 176 | return IRQ_HANDLED; |
@@ -335,8 +337,7 @@ static int eurwdt_release(struct inode *inode, struct file *file) | |||
335 | if (eur_expect_close == 42) | 337 | if (eur_expect_close == 42) |
336 | eurwdt_disable_timer(); | 338 | eurwdt_disable_timer(); |
337 | else { | 339 | else { |
338 | printk(KERN_CRIT | 340 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
339 | "eurwdt: Unexpected close, not stopping watchdog!\n"); | ||
340 | eurwdt_ping(); | 341 | eurwdt_ping(); |
341 | } | 342 | } |
342 | clear_bit(0, &eurwdt_is_open); | 343 | clear_bit(0, &eurwdt_is_open); |
@@ -429,35 +430,32 @@ static int __init eurwdt_init(void) | |||
429 | 430 | ||
430 | ret = request_irq(irq, eurwdt_interrupt, 0, "eurwdt", NULL); | 431 | ret = request_irq(irq, eurwdt_interrupt, 0, "eurwdt", NULL); |
431 | if (ret) { | 432 | if (ret) { |
432 | printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq); | 433 | pr_err("IRQ %d is not free\n", irq); |
433 | goto out; | 434 | goto out; |
434 | } | 435 | } |
435 | 436 | ||
436 | if (!request_region(io, 2, "eurwdt")) { | 437 | if (!request_region(io, 2, "eurwdt")) { |
437 | printk(KERN_ERR "eurwdt: IO %X is not free.\n", io); | 438 | pr_err("IO %X is not free\n", io); |
438 | ret = -EBUSY; | 439 | ret = -EBUSY; |
439 | goto outirq; | 440 | goto outirq; |
440 | } | 441 | } |
441 | 442 | ||
442 | ret = register_reboot_notifier(&eurwdt_notifier); | 443 | ret = register_reboot_notifier(&eurwdt_notifier); |
443 | if (ret) { | 444 | if (ret) { |
444 | printk(KERN_ERR | 445 | pr_err("can't register reboot notifier (err=%d)\n", ret); |
445 | "eurwdt: can't register reboot notifier (err=%d)\n", ret); | ||
446 | goto outreg; | 446 | goto outreg; |
447 | } | 447 | } |
448 | 448 | ||
449 | ret = misc_register(&eurwdt_miscdev); | 449 | ret = misc_register(&eurwdt_miscdev); |
450 | if (ret) { | 450 | if (ret) { |
451 | printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n", | 451 | pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR); |
452 | WATCHDOG_MINOR); | ||
453 | goto outreboot; | 452 | goto outreboot; |
454 | } | 453 | } |
455 | 454 | ||
456 | eurwdt_unlock_chip(); | 455 | eurwdt_unlock_chip(); |
457 | 456 | ||
458 | ret = 0; | 457 | ret = 0; |
459 | printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)" | 458 | pr_info("Eurotech WDT driver 0.01 at %X (Interrupt %d) - timeout event: %s\n", |
460 | " - timeout event: %s\n", | ||
461 | io, irq, (!strcmp("int", ev) ? "int" : "reboot")); | 459 | io, irq, (!strcmp("int", ev) ? "int" : "reboot")); |
462 | 460 | ||
463 | out: | 461 | out: |
diff --git a/drivers/watchdog/f71808e_wdt.c b/drivers/watchdog/f71808e_wdt.c index e45ca2b4bfbe..c65b0a5a020c 100644 --- a/drivers/watchdog/f71808e_wdt.c +++ b/drivers/watchdog/f71808e_wdt.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * | 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
20 | ***************************************************************************/ | 20 | ***************************************************************************/ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #include <linux/err.h> | 24 | #include <linux/err.h> |
23 | #include <linux/fs.h> | 25 | #include <linux/fs.h> |
24 | #include <linux/init.h> | 26 | #include <linux/init.h> |
@@ -189,8 +191,7 @@ static inline int superio_enter(int base) | |||
189 | { | 191 | { |
190 | /* Don't step on other drivers' I/O space by accident */ | 192 | /* Don't step on other drivers' I/O space by accident */ |
191 | if (!request_muxed_region(base, 2, DRVNAME)) { | 193 | if (!request_muxed_region(base, 2, DRVNAME)) { |
192 | printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n", | 194 | pr_err("I/O address 0x%04x already in use\n", (int)base); |
193 | (int)base); | ||
194 | return -EBUSY; | 195 | return -EBUSY; |
195 | } | 196 | } |
196 | 197 | ||
@@ -217,7 +218,7 @@ static int watchdog_set_timeout(int timeout) | |||
217 | { | 218 | { |
218 | if (timeout <= 0 | 219 | if (timeout <= 0 |
219 | || timeout > max_timeout) { | 220 | || timeout > max_timeout) { |
220 | printk(KERN_ERR DRVNAME ": watchdog timeout out of range\n"); | 221 | pr_err("watchdog timeout out of range\n"); |
221 | return -EINVAL; | 222 | return -EINVAL; |
222 | } | 223 | } |
223 | 224 | ||
@@ -252,7 +253,7 @@ static int watchdog_set_pulse_width(unsigned int pw) | |||
252 | } else if (pw <= 5000) { | 253 | } else if (pw <= 5000) { |
253 | watchdog.pulse_val = 3; | 254 | watchdog.pulse_val = 3; |
254 | } else { | 255 | } else { |
255 | printk(KERN_ERR DRVNAME ": pulse width out of range\n"); | 256 | pr_err("pulse width out of range\n"); |
256 | err = -EINVAL; | 257 | err = -EINVAL; |
257 | goto exit_unlock; | 258 | goto exit_unlock; |
258 | } | 259 | } |
@@ -309,8 +310,7 @@ static int f71862fg_pin_configure(unsigned short ioaddr) | |||
309 | if (ioaddr) | 310 | if (ioaddr) |
310 | superio_set_bit(ioaddr, SIO_REG_MFUNCT1, 1); | 311 | superio_set_bit(ioaddr, SIO_REG_MFUNCT1, 1); |
311 | } else { | 312 | } else { |
312 | printk(KERN_ERR DRVNAME ": Invalid argument f71862fg_pin=%d\n", | 313 | pr_err("Invalid argument f71862fg_pin=%d\n", f71862fg_pin); |
313 | f71862fg_pin); | ||
314 | return -EINVAL; | 314 | return -EINVAL; |
315 | } | 315 | } |
316 | return 0; | 316 | return 0; |
@@ -487,8 +487,7 @@ static int watchdog_release(struct inode *inode, struct file *file) | |||
487 | 487 | ||
488 | if (!watchdog.expect_close) { | 488 | if (!watchdog.expect_close) { |
489 | watchdog_keepalive(); | 489 | watchdog_keepalive(); |
490 | printk(KERN_CRIT DRVNAME | 490 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
491 | ": Unexpected close, not stopping watchdog!\n"); | ||
492 | } else if (!nowayout) { | 491 | } else if (!nowayout) { |
493 | watchdog_stop(); | 492 | watchdog_stop(); |
494 | } | 493 | } |
@@ -672,25 +671,22 @@ static int __init watchdog_init(int sioaddr) | |||
672 | 671 | ||
673 | err = misc_register(&watchdog_miscdev); | 672 | err = misc_register(&watchdog_miscdev); |
674 | if (err) { | 673 | if (err) { |
675 | printk(KERN_ERR DRVNAME | 674 | pr_err("cannot register miscdev on minor=%d\n", |
676 | ": cannot register miscdev on minor=%d\n", | 675 | watchdog_miscdev.minor); |
677 | watchdog_miscdev.minor); | ||
678 | goto exit_reboot; | 676 | goto exit_reboot; |
679 | } | 677 | } |
680 | 678 | ||
681 | if (start_withtimeout) { | 679 | if (start_withtimeout) { |
682 | if (start_withtimeout <= 0 | 680 | if (start_withtimeout <= 0 |
683 | || start_withtimeout > max_timeout) { | 681 | || start_withtimeout > max_timeout) { |
684 | printk(KERN_ERR DRVNAME | 682 | pr_err("starting timeout out of range\n"); |
685 | ": starting timeout out of range\n"); | ||
686 | err = -EINVAL; | 683 | err = -EINVAL; |
687 | goto exit_miscdev; | 684 | goto exit_miscdev; |
688 | } | 685 | } |
689 | 686 | ||
690 | err = watchdog_start(); | 687 | err = watchdog_start(); |
691 | if (err) { | 688 | if (err) { |
692 | printk(KERN_ERR DRVNAME | 689 | pr_err("cannot start watchdog timer\n"); |
693 | ": cannot start watchdog timer\n"); | ||
694 | goto exit_miscdev; | 690 | goto exit_miscdev; |
695 | } | 691 | } |
696 | 692 | ||
@@ -720,8 +716,7 @@ static int __init watchdog_init(int sioaddr) | |||
720 | if (nowayout) | 716 | if (nowayout) |
721 | __module_get(THIS_MODULE); | 717 | __module_get(THIS_MODULE); |
722 | 718 | ||
723 | printk(KERN_INFO DRVNAME | 719 | pr_info("watchdog started with initial timeout of %u sec\n", |
724 | ": watchdog started with initial timeout of %u sec\n", | ||
725 | start_withtimeout); | 720 | start_withtimeout); |
726 | } | 721 | } |
727 | 722 | ||
@@ -746,7 +741,7 @@ static int __init f71808e_find(int sioaddr) | |||
746 | 741 | ||
747 | devid = superio_inw(sioaddr, SIO_REG_MANID); | 742 | devid = superio_inw(sioaddr, SIO_REG_MANID); |
748 | if (devid != SIO_FINTEK_ID) { | 743 | if (devid != SIO_FINTEK_ID) { |
749 | pr_debug(DRVNAME ": Not a Fintek device\n"); | 744 | pr_debug("Not a Fintek device\n"); |
750 | err = -ENODEV; | 745 | err = -ENODEV; |
751 | goto exit; | 746 | goto exit; |
752 | } | 747 | } |
@@ -774,13 +769,13 @@ static int __init f71808e_find(int sioaddr) | |||
774 | err = -ENODEV; | 769 | err = -ENODEV; |
775 | goto exit; | 770 | goto exit; |
776 | default: | 771 | default: |
777 | printk(KERN_INFO DRVNAME ": Unrecognized Fintek device: %04x\n", | 772 | pr_info("Unrecognized Fintek device: %04x\n", |
778 | (unsigned int)devid); | 773 | (unsigned int)devid); |
779 | err = -ENODEV; | 774 | err = -ENODEV; |
780 | goto exit; | 775 | goto exit; |
781 | } | 776 | } |
782 | 777 | ||
783 | printk(KERN_INFO DRVNAME ": Found %s watchdog chip, revision %d\n", | 778 | pr_info("Found %s watchdog chip, revision %d\n", |
784 | f71808e_names[watchdog.type], | 779 | f71808e_names[watchdog.type], |
785 | (int)superio_inb(sioaddr, SIO_REG_DEVREV)); | 780 | (int)superio_inb(sioaddr, SIO_REG_DEVREV)); |
786 | exit: | 781 | exit: |
@@ -808,8 +803,7 @@ static int __init f71808e_init(void) | |||
808 | static void __exit f71808e_exit(void) | 803 | static void __exit f71808e_exit(void) |
809 | { | 804 | { |
810 | if (watchdog_is_running()) { | 805 | if (watchdog_is_running()) { |
811 | printk(KERN_WARNING DRVNAME | 806 | pr_warn("Watchdog timer still running, stopping it\n"); |
812 | ": Watchdog timer still running, stopping it\n"); | ||
813 | watchdog_stop(); | 807 | watchdog_stop(); |
814 | } | 808 | } |
815 | misc_deregister(&watchdog_miscdev); | 809 | misc_deregister(&watchdog_miscdev); |
diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c index b146082bd85a..d95203be37ad 100644 --- a/drivers/watchdog/gef_wdt.c +++ b/drivers/watchdog/gef_wdt.c | |||
@@ -24,6 +24,8 @@ | |||
24 | * capabilities) a kernel-based watchdog. | 24 | * capabilities) a kernel-based watchdog. |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
28 | |||
27 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
28 | #include <linux/compiler.h> | 30 | #include <linux/compiler.h> |
29 | #include <linux/init.h> | 31 | #include <linux/init.h> |
@@ -110,7 +112,7 @@ static void gef_wdt_handler_enable(void) | |||
110 | if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_FALSE, | 112 | if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_FALSE, |
111 | GEF_WDC_ENABLE_SHIFT)) { | 113 | GEF_WDC_ENABLE_SHIFT)) { |
112 | gef_wdt_service(); | 114 | gef_wdt_service(); |
113 | printk(KERN_NOTICE "gef_wdt: watchdog activated\n"); | 115 | pr_notice("watchdog activated\n"); |
114 | } | 116 | } |
115 | } | 117 | } |
116 | 118 | ||
@@ -118,7 +120,7 @@ static void gef_wdt_handler_disable(void) | |||
118 | { | 120 | { |
119 | if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_TRUE, | 121 | if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_TRUE, |
120 | GEF_WDC_ENABLE_SHIFT)) | 122 | GEF_WDC_ENABLE_SHIFT)) |
121 | printk(KERN_NOTICE "gef_wdt: watchdog deactivated\n"); | 123 | pr_notice("watchdog deactivated\n"); |
122 | } | 124 | } |
123 | 125 | ||
124 | static void gef_wdt_set_timeout(unsigned int timeout) | 126 | static void gef_wdt_set_timeout(unsigned int timeout) |
@@ -234,8 +236,7 @@ static int gef_wdt_release(struct inode *inode, struct file *file) | |||
234 | if (expect_close == 42) | 236 | if (expect_close == 42) |
235 | gef_wdt_handler_disable(); | 237 | gef_wdt_handler_disable(); |
236 | else { | 238 | else { |
237 | printk(KERN_CRIT | 239 | pr_crit("unexpected close, not stopping timer!\n"); |
238 | "gef_wdt: unexpected close, not stopping timer!\n"); | ||
239 | gef_wdt_service(); | 240 | gef_wdt_service(); |
240 | } | 241 | } |
241 | expect_close = 0; | 242 | expect_close = 0; |
@@ -313,7 +314,7 @@ static struct platform_driver gef_wdt_driver = { | |||
313 | 314 | ||
314 | static int __init gef_wdt_init(void) | 315 | static int __init gef_wdt_init(void) |
315 | { | 316 | { |
316 | printk(KERN_INFO "GE watchdog driver\n"); | 317 | pr_info("GE watchdog driver\n"); |
317 | return platform_driver_register(&gef_wdt_driver); | 318 | return platform_driver_register(&gef_wdt_driver); |
318 | } | 319 | } |
319 | 320 | ||
diff --git a/drivers/watchdog/geodewdt.c b/drivers/watchdog/geodewdt.c index 9b49b125ad5a..19044a39c407 100644 --- a/drivers/watchdog/geodewdt.c +++ b/drivers/watchdog/geodewdt.c | |||
@@ -9,6 +9,7 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
12 | 13 | ||
13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
14 | #include <linux/moduleparam.h> | 15 | #include <linux/moduleparam.h> |
@@ -100,7 +101,7 @@ static int geodewdt_release(struct inode *inode, struct file *file) | |||
100 | geodewdt_disable(); | 101 | geodewdt_disable(); |
101 | module_put(THIS_MODULE); | 102 | module_put(THIS_MODULE); |
102 | } else { | 103 | } else { |
103 | printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n"); | 104 | pr_crit("Unexpected close - watchdog is not stopping\n"); |
104 | geodewdt_ping(); | 105 | geodewdt_ping(); |
105 | 106 | ||
106 | set_bit(WDT_FLAGS_ORPHAN, &wdt_flags); | 107 | set_bit(WDT_FLAGS_ORPHAN, &wdt_flags); |
@@ -220,7 +221,7 @@ static int __devinit geodewdt_probe(struct platform_device *dev) | |||
220 | 221 | ||
221 | wdt_timer = cs5535_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING); | 222 | wdt_timer = cs5535_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING); |
222 | if (!wdt_timer) { | 223 | if (!wdt_timer) { |
223 | printk(KERN_ERR "geodewdt: No timers were available\n"); | 224 | pr_err("No timers were available\n"); |
224 | return -ENODEV; | 225 | return -ENODEV; |
225 | } | 226 | } |
226 | 227 | ||
diff --git a/drivers/watchdog/hpwdt.c b/drivers/watchdog/hpwdt.c index 3c166d3f4e55..54c64f56af2a 100644 --- a/drivers/watchdog/hpwdt.c +++ b/drivers/watchdog/hpwdt.c | |||
@@ -13,6 +13,8 @@ | |||
13 | * | 13 | * |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
17 | |||
16 | #include <linux/device.h> | 18 | #include <linux/device.h> |
17 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
18 | #include <linux/init.h> | 20 | #include <linux/init.h> |
@@ -235,8 +237,7 @@ static int __devinit cru_detect(unsigned long map_entry, | |||
235 | asminline_call(&cmn_regs, bios32_entrypoint); | 237 | asminline_call(&cmn_regs, bios32_entrypoint); |
236 | 238 | ||
237 | if (cmn_regs.u1.ral != 0) { | 239 | if (cmn_regs.u1.ral != 0) { |
238 | printk(KERN_WARNING | 240 | pr_warn("Call succeeded but with an error: 0x%x\n", |
239 | "hpwdt: Call succeeded but with an error: 0x%x\n", | ||
240 | cmn_regs.u1.ral); | 241 | cmn_regs.u1.ral); |
241 | } else { | 242 | } else { |
242 | physical_bios_base = cmn_regs.u2.rebx; | 243 | physical_bios_base = cmn_regs.u2.rebx; |
@@ -256,14 +257,10 @@ static int __devinit cru_detect(unsigned long map_entry, | |||
256 | } | 257 | } |
257 | } | 258 | } |
258 | 259 | ||
259 | printk(KERN_DEBUG "hpwdt: CRU Base Address: 0x%lx\n", | 260 | pr_debug("CRU Base Address: 0x%lx\n", physical_bios_base); |
260 | physical_bios_base); | 261 | pr_debug("CRU Offset Address: 0x%lx\n", physical_bios_offset); |
261 | printk(KERN_DEBUG "hpwdt: CRU Offset Address: 0x%lx\n", | 262 | pr_debug("CRU Length: 0x%lx\n", cru_length); |
262 | physical_bios_offset); | 263 | pr_debug("CRU Mapped Address: %p\n", &cru_rom_addr); |
263 | printk(KERN_DEBUG "hpwdt: CRU Length: 0x%lx\n", | ||
264 | cru_length); | ||
265 | printk(KERN_DEBUG "hpwdt: CRU Mapped Address: %p\n", | ||
266 | &cru_rom_addr); | ||
267 | } | 264 | } |
268 | iounmap(bios32_map); | 265 | iounmap(bios32_map); |
269 | return retval; | 266 | return retval; |
@@ -458,16 +455,13 @@ static void hpwdt_ping(void) | |||
458 | static int hpwdt_change_timer(int new_margin) | 455 | static int hpwdt_change_timer(int new_margin) |
459 | { | 456 | { |
460 | if (new_margin < 1 || new_margin > HPWDT_MAX_TIMER) { | 457 | if (new_margin < 1 || new_margin > HPWDT_MAX_TIMER) { |
461 | printk(KERN_WARNING | 458 | pr_warn("New value passed in is invalid: %d seconds\n", |
462 | "hpwdt: New value passed in is invalid: %d seconds.\n", | ||
463 | new_margin); | 459 | new_margin); |
464 | return -EINVAL; | 460 | return -EINVAL; |
465 | } | 461 | } |
466 | 462 | ||
467 | soft_margin = new_margin; | 463 | soft_margin = new_margin; |
468 | printk(KERN_DEBUG | 464 | pr_debug("New timer passed in is %d seconds\n", new_margin); |
469 | "hpwdt: New timer passed in is %d seconds.\n", | ||
470 | new_margin); | ||
471 | reload = SECS_TO_TICKS(soft_margin); | 465 | reload = SECS_TO_TICKS(soft_margin); |
472 | 466 | ||
473 | return 0; | 467 | return 0; |
@@ -535,8 +529,7 @@ static int hpwdt_release(struct inode *inode, struct file *file) | |||
535 | if (expect_release == 42) { | 529 | if (expect_release == 42) { |
536 | hpwdt_stop(); | 530 | hpwdt_stop(); |
537 | } else { | 531 | } else { |
538 | printk(KERN_CRIT | 532 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
539 | "hpwdt: Unexpected close, not stopping watchdog!\n"); | ||
540 | hpwdt_ping(); | 533 | hpwdt_ping(); |
541 | } | 534 | } |
542 | 535 | ||
diff --git a/drivers/watchdog/i6300esb.c b/drivers/watchdog/i6300esb.c index db45091ef434..15548e622754 100644 --- a/drivers/watchdog/i6300esb.c +++ b/drivers/watchdog/i6300esb.c | |||
@@ -27,6 +27,8 @@ | |||
27 | * Includes, defines, variables, module parameters, ... | 27 | * Includes, defines, variables, module parameters, ... |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
31 | |||
30 | #include <linux/module.h> | 32 | #include <linux/module.h> |
31 | #include <linux/types.h> | 33 | #include <linux/types.h> |
32 | #include <linux/kernel.h> | 34 | #include <linux/kernel.h> |
@@ -44,7 +46,6 @@ | |||
44 | #define ESB_VERSION "0.05" | 46 | #define ESB_VERSION "0.05" |
45 | #define ESB_MODULE_NAME "i6300ESB timer" | 47 | #define ESB_MODULE_NAME "i6300ESB timer" |
46 | #define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION | 48 | #define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION |
47 | #define PFX ESB_MODULE_NAME ": " | ||
48 | 49 | ||
49 | /* PCI configuration registers */ | 50 | /* PCI configuration registers */ |
50 | #define ESB_CONFIG_REG 0x60 /* Config register */ | 51 | #define ESB_CONFIG_REG 0x60 /* Config register */ |
@@ -213,8 +214,7 @@ static int esb_release(struct inode *inode, struct file *file) | |||
213 | if (esb_expect_close == 42) | 214 | if (esb_expect_close == 42) |
214 | esb_timer_stop(); | 215 | esb_timer_stop(); |
215 | else { | 216 | else { |
216 | printk(KERN_CRIT PFX | 217 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
217 | "Unexpected close, not stopping watchdog!\n"); | ||
218 | esb_timer_keepalive(); | 218 | esb_timer_keepalive(); |
219 | } | 219 | } |
220 | clear_bit(0, &timer_alive); | 220 | clear_bit(0, &timer_alive); |
@@ -347,19 +347,19 @@ MODULE_DEVICE_TABLE(pci, esb_pci_tbl); | |||
347 | static unsigned char __devinit esb_getdevice(struct pci_dev *pdev) | 347 | static unsigned char __devinit esb_getdevice(struct pci_dev *pdev) |
348 | { | 348 | { |
349 | if (pci_enable_device(pdev)) { | 349 | if (pci_enable_device(pdev)) { |
350 | printk(KERN_ERR PFX "failed to enable device\n"); | 350 | pr_err("failed to enable device\n"); |
351 | goto err_devput; | 351 | goto err_devput; |
352 | } | 352 | } |
353 | 353 | ||
354 | if (pci_request_region(pdev, 0, ESB_MODULE_NAME)) { | 354 | if (pci_request_region(pdev, 0, ESB_MODULE_NAME)) { |
355 | printk(KERN_ERR PFX "failed to request region\n"); | 355 | pr_err("failed to request region\n"); |
356 | goto err_disable; | 356 | goto err_disable; |
357 | } | 357 | } |
358 | 358 | ||
359 | BASEADDR = pci_ioremap_bar(pdev, 0); | 359 | BASEADDR = pci_ioremap_bar(pdev, 0); |
360 | if (BASEADDR == NULL) { | 360 | if (BASEADDR == NULL) { |
361 | /* Something's wrong here, BASEADDR has to be set */ | 361 | /* Something's wrong here, BASEADDR has to be set */ |
362 | printk(KERN_ERR PFX "failed to get BASEADDR\n"); | 362 | pr_err("failed to get BASEADDR\n"); |
363 | goto err_release; | 363 | goto err_release; |
364 | } | 364 | } |
365 | 365 | ||
@@ -397,7 +397,7 @@ static void __devinit esb_initdevice(void) | |||
397 | /* Check that the WDT isn't already locked */ | 397 | /* Check that the WDT isn't already locked */ |
398 | pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val1); | 398 | pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val1); |
399 | if (val1 & ESB_WDT_LOCK) | 399 | if (val1 & ESB_WDT_LOCK) |
400 | printk(KERN_WARNING PFX "nowayout already set\n"); | 400 | pr_warn("nowayout already set\n"); |
401 | 401 | ||
402 | /* Set the timer to watchdog mode and disable it for now */ | 402 | /* Set the timer to watchdog mode and disable it for now */ |
403 | pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x00); | 403 | pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x00); |
@@ -423,11 +423,11 @@ static int __devinit esb_probe(struct pci_dev *pdev, | |||
423 | 423 | ||
424 | cards_found++; | 424 | cards_found++; |
425 | if (cards_found == 1) | 425 | if (cards_found == 1) |
426 | printk(KERN_INFO PFX "Intel 6300ESB WatchDog Timer Driver v%s\n", | 426 | pr_info("Intel 6300ESB WatchDog Timer Driver v%s\n", |
427 | ESB_VERSION); | 427 | ESB_VERSION); |
428 | 428 | ||
429 | if (cards_found > 1) { | 429 | if (cards_found > 1) { |
430 | printk(KERN_ERR PFX "This driver only supports 1 device\n"); | 430 | pr_err("This driver only supports 1 device\n"); |
431 | return -ENODEV; | 431 | return -ENODEV; |
432 | } | 432 | } |
433 | 433 | ||
@@ -439,9 +439,8 @@ static int __devinit esb_probe(struct pci_dev *pdev, | |||
439 | if not reset to the default */ | 439 | if not reset to the default */ |
440 | if (heartbeat < 0x1 || heartbeat > 2 * 0x03ff) { | 440 | if (heartbeat < 0x1 || heartbeat > 2 * 0x03ff) { |
441 | heartbeat = WATCHDOG_HEARTBEAT; | 441 | heartbeat = WATCHDOG_HEARTBEAT; |
442 | printk(KERN_INFO PFX | 442 | pr_info("heartbeat value must be 1<heartbeat<2046, using %d\n", |
443 | "heartbeat value must be 1<heartbeat<2046, using %d\n", | 443 | heartbeat); |
444 | heartbeat); | ||
445 | } | 444 | } |
446 | 445 | ||
447 | /* Initialize the watchdog and make sure it does not run */ | 446 | /* Initialize the watchdog and make sure it does not run */ |
@@ -450,14 +449,12 @@ static int __devinit esb_probe(struct pci_dev *pdev, | |||
450 | /* Register the watchdog so that userspace has access to it */ | 449 | /* Register the watchdog so that userspace has access to it */ |
451 | ret = misc_register(&esb_miscdev); | 450 | ret = misc_register(&esb_miscdev); |
452 | if (ret != 0) { | 451 | if (ret != 0) { |
453 | printk(KERN_ERR PFX | 452 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
454 | "cannot register miscdev on minor=%d (err=%d)\n", | 453 | WATCHDOG_MINOR, ret); |
455 | WATCHDOG_MINOR, ret); | ||
456 | goto err_unmap; | 454 | goto err_unmap; |
457 | } | 455 | } |
458 | printk(KERN_INFO PFX | 456 | pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", |
459 | "initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", | 457 | BASEADDR, heartbeat, nowayout); |
460 | BASEADDR, heartbeat, nowayout); | ||
461 | return 0; | 458 | return 0; |
462 | 459 | ||
463 | err_unmap: | 460 | err_unmap: |
@@ -503,7 +500,7 @@ static int __init watchdog_init(void) | |||
503 | static void __exit watchdog_cleanup(void) | 500 | static void __exit watchdog_cleanup(void) |
504 | { | 501 | { |
505 | pci_unregister_driver(&esb_driver); | 502 | pci_unregister_driver(&esb_driver); |
506 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 503 | pr_info("Watchdog Module Unloaded\n"); |
507 | } | 504 | } |
508 | 505 | ||
509 | module_init(watchdog_init); | 506 | module_init(watchdog_init); |
diff --git a/drivers/watchdog/iTCO_vendor_support.c b/drivers/watchdog/iTCO_vendor_support.c index 481d1ad43464..2721d29ce243 100644 --- a/drivers/watchdog/iTCO_vendor_support.c +++ b/drivers/watchdog/iTCO_vendor_support.c | |||
@@ -17,10 +17,11 @@ | |||
17 | * Includes, defines, variables, module parameters, ... | 17 | * Includes, defines, variables, module parameters, ... |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | /* Module and version information */ | 22 | /* Module and version information */ |
21 | #define DRV_NAME "iTCO_vendor_support" | 23 | #define DRV_NAME "iTCO_vendor_support" |
22 | #define DRV_VERSION "1.04" | 24 | #define DRV_VERSION "1.04" |
23 | #define PFX DRV_NAME ": " | ||
24 | 25 | ||
25 | /* Includes */ | 26 | /* Includes */ |
26 | #include <linux/module.h> /* For module specific items */ | 27 | #include <linux/module.h> /* For module specific items */ |
@@ -355,13 +356,13 @@ EXPORT_SYMBOL(iTCO_vendor_check_noreboot_on); | |||
355 | 356 | ||
356 | static int __init iTCO_vendor_init_module(void) | 357 | static int __init iTCO_vendor_init_module(void) |
357 | { | 358 | { |
358 | printk(KERN_INFO PFX "vendor-support=%d\n", vendorsupport); | 359 | pr_info("vendor-support=%d\n", vendorsupport); |
359 | return 0; | 360 | return 0; |
360 | } | 361 | } |
361 | 362 | ||
362 | static void __exit iTCO_vendor_exit_module(void) | 363 | static void __exit iTCO_vendor_exit_module(void) |
363 | { | 364 | { |
364 | printk(KERN_INFO PFX "Module Unloaded\n"); | 365 | pr_info("Module Unloaded\n"); |
365 | } | 366 | } |
366 | 367 | ||
367 | module_init(iTCO_vendor_init_module); | 368 | module_init(iTCO_vendor_init_module); |
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index bdf401b240b5..3b4db72f6ac8 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
@@ -43,10 +43,11 @@ | |||
43 | * Includes, defines, variables, module parameters, ... | 43 | * Includes, defines, variables, module parameters, ... |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
47 | |||
46 | /* Module and version information */ | 48 | /* Module and version information */ |
47 | #define DRV_NAME "iTCO_wdt" | 49 | #define DRV_NAME "iTCO_wdt" |
48 | #define DRV_VERSION "1.07" | 50 | #define DRV_VERSION "1.07" |
49 | #define PFX DRV_NAME ": " | ||
50 | 51 | ||
51 | /* Includes */ | 52 | /* Includes */ |
52 | #include <linux/module.h> /* For module specific items */ | 53 | #include <linux/module.h> /* For module specific items */ |
@@ -489,8 +490,7 @@ static int iTCO_wdt_start(void) | |||
489 | /* disable chipset's NO_REBOOT bit */ | 490 | /* disable chipset's NO_REBOOT bit */ |
490 | if (iTCO_wdt_unset_NO_REBOOT_bit()) { | 491 | if (iTCO_wdt_unset_NO_REBOOT_bit()) { |
491 | spin_unlock(&iTCO_wdt_private.io_lock); | 492 | spin_unlock(&iTCO_wdt_private.io_lock); |
492 | printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, " | 493 | pr_err("failed to reset NO_REBOOT flag, reboot disabled by hardware/BIOS\n"); |
493 | "reboot disabled by hardware/BIOS\n"); | ||
494 | return -EIO; | 494 | return -EIO; |
495 | } | 495 | } |
496 | 496 | ||
@@ -661,8 +661,7 @@ static int iTCO_wdt_release(struct inode *inode, struct file *file) | |||
661 | if (expect_release == 42) { | 661 | if (expect_release == 42) { |
662 | iTCO_wdt_stop(); | 662 | iTCO_wdt_stop(); |
663 | } else { | 663 | } else { |
664 | printk(KERN_CRIT PFX | 664 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
665 | "Unexpected close, not stopping watchdog!\n"); | ||
666 | iTCO_wdt_keepalive(); | 665 | iTCO_wdt_keepalive(); |
667 | } | 666 | } |
668 | clear_bit(0, &is_active); | 667 | clear_bit(0, &is_active); |
@@ -804,8 +803,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
804 | base_address &= 0x0000ff80; | 803 | base_address &= 0x0000ff80; |
805 | if (base_address == 0x00000000) { | 804 | if (base_address == 0x00000000) { |
806 | /* Something's wrong here, ACPIBASE has to be set */ | 805 | /* Something's wrong here, ACPIBASE has to be set */ |
807 | printk(KERN_ERR PFX "failed to get TCOBASE address, " | 806 | pr_err("failed to get TCOBASE address, device disabled by hardware/BIOS\n"); |
808 | "device disabled by hardware/BIOS\n"); | ||
809 | return -ENODEV; | 807 | return -ENODEV; |
810 | } | 808 | } |
811 | iTCO_wdt_private.iTCO_version = | 809 | iTCO_wdt_private.iTCO_version = |
@@ -820,8 +818,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
820 | if (iTCO_wdt_private.iTCO_version == 2) { | 818 | if (iTCO_wdt_private.iTCO_version == 2) { |
821 | pci_read_config_dword(pdev, 0xf0, &base_address); | 819 | pci_read_config_dword(pdev, 0xf0, &base_address); |
822 | if ((base_address & 1) == 0) { | 820 | if ((base_address & 1) == 0) { |
823 | printk(KERN_ERR PFX "RCBA is disabled by hardware" | 821 | pr_err("RCBA is disabled by hardware/BIOS, device disabled\n"); |
824 | "/BIOS, device disabled\n"); | ||
825 | ret = -ENODEV; | 822 | ret = -ENODEV; |
826 | goto out; | 823 | goto out; |
827 | } | 824 | } |
@@ -831,8 +828,7 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
831 | 828 | ||
832 | /* Check chipset's NO_REBOOT bit */ | 829 | /* Check chipset's NO_REBOOT bit */ |
833 | if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) { | 830 | if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) { |
834 | printk(KERN_INFO PFX "unable to reset NO_REBOOT flag, " | 831 | pr_info("unable to reset NO_REBOOT flag, device disabled by hardware/BIOS\n"); |
835 | "device disabled by hardware/BIOS\n"); | ||
836 | ret = -ENODEV; /* Cannot reset NO_REBOOT bit */ | 832 | ret = -ENODEV; /* Cannot reset NO_REBOOT bit */ |
837 | goto out_unmap; | 833 | goto out_unmap; |
838 | } | 834 | } |
@@ -842,9 +838,8 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
842 | 838 | ||
843 | /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ | 839 | /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ |
844 | if (!request_region(SMI_EN, 4, "iTCO_wdt")) { | 840 | if (!request_region(SMI_EN, 4, "iTCO_wdt")) { |
845 | printk(KERN_ERR PFX | 841 | pr_err("I/O address 0x%04lx already in use, device disabled\n", |
846 | "I/O address 0x%04lx already in use, " | 842 | SMI_EN); |
847 | "device disabled\n", SMI_EN); | ||
848 | ret = -EIO; | 843 | ret = -EIO; |
849 | goto out_unmap; | 844 | goto out_unmap; |
850 | } | 845 | } |
@@ -858,17 +853,16 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
858 | /* The TCO I/O registers reside in a 32-byte range pointed to | 853 | /* The TCO I/O registers reside in a 32-byte range pointed to |
859 | by the TCOBASE value */ | 854 | by the TCOBASE value */ |
860 | if (!request_region(TCOBASE, 0x20, "iTCO_wdt")) { | 855 | if (!request_region(TCOBASE, 0x20, "iTCO_wdt")) { |
861 | printk(KERN_ERR PFX "I/O address 0x%04lx already in use " | 856 | pr_err("I/O address 0x%04lx already in use, device disabled\n", |
862 | "device disabled\n", TCOBASE); | 857 | TCOBASE); |
863 | ret = -EIO; | 858 | ret = -EIO; |
864 | goto unreg_smi_en; | 859 | goto unreg_smi_en; |
865 | } | 860 | } |
866 | 861 | ||
867 | printk(KERN_INFO PFX | 862 | pr_info("Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n", |
868 | "Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n", | 863 | iTCO_chipset_info[ent->driver_data].name, |
869 | iTCO_chipset_info[ent->driver_data].name, | 864 | iTCO_chipset_info[ent->driver_data].iTCO_version, |
870 | iTCO_chipset_info[ent->driver_data].iTCO_version, | 865 | TCOBASE); |
871 | TCOBASE); | ||
872 | 866 | ||
873 | /* Clear out the (probably old) status */ | 867 | /* Clear out the (probably old) status */ |
874 | outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */ | 868 | outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */ |
@@ -882,20 +876,18 @@ static int __devinit iTCO_wdt_init(struct pci_dev *pdev, | |||
882 | if not reset to the default */ | 876 | if not reset to the default */ |
883 | if (iTCO_wdt_set_heartbeat(heartbeat)) { | 877 | if (iTCO_wdt_set_heartbeat(heartbeat)) { |
884 | iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT); | 878 | iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT); |
885 | printk(KERN_INFO PFX | 879 | pr_info("timeout value out of range, using %d\n", heartbeat); |
886 | "timeout value out of range, using %d\n", heartbeat); | ||
887 | } | 880 | } |
888 | 881 | ||
889 | ret = misc_register(&iTCO_wdt_miscdev); | 882 | ret = misc_register(&iTCO_wdt_miscdev); |
890 | if (ret != 0) { | 883 | if (ret != 0) { |
891 | printk(KERN_ERR PFX | 884 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
892 | "cannot register miscdev on minor=%d (err=%d)\n", | 885 | WATCHDOG_MINOR, ret); |
893 | WATCHDOG_MINOR, ret); | ||
894 | goto unreg_region; | 886 | goto unreg_region; |
895 | } | 887 | } |
896 | 888 | ||
897 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 889 | pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", |
898 | heartbeat, nowayout); | 890 | heartbeat, nowayout); |
899 | 891 | ||
900 | return 0; | 892 | return 0; |
901 | 893 | ||
@@ -947,7 +939,7 @@ static int __devinit iTCO_wdt_probe(struct platform_device *dev) | |||
947 | } | 939 | } |
948 | 940 | ||
949 | if (!found) | 941 | if (!found) |
950 | printk(KERN_INFO PFX "No device detected.\n"); | 942 | pr_info("No device detected\n"); |
951 | 943 | ||
952 | return ret; | 944 | return ret; |
953 | } | 945 | } |
@@ -979,8 +971,7 @@ static int __init iTCO_wdt_init_module(void) | |||
979 | { | 971 | { |
980 | int err; | 972 | int err; |
981 | 973 | ||
982 | printk(KERN_INFO PFX "Intel TCO WatchDog Timer Driver v%s\n", | 974 | pr_info("Intel TCO WatchDog Timer Driver v%s\n", DRV_VERSION); |
983 | DRV_VERSION); | ||
984 | 975 | ||
985 | err = platform_driver_register(&iTCO_wdt_driver); | 976 | err = platform_driver_register(&iTCO_wdt_driver); |
986 | if (err) | 977 | if (err) |
@@ -1004,7 +995,7 @@ static void __exit iTCO_wdt_cleanup_module(void) | |||
1004 | { | 995 | { |
1005 | platform_device_unregister(iTCO_wdt_platform_device); | 996 | platform_device_unregister(iTCO_wdt_platform_device); |
1006 | platform_driver_unregister(&iTCO_wdt_driver); | 997 | platform_driver_unregister(&iTCO_wdt_driver); |
1007 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 998 | pr_info("Watchdog Module Unloaded\n"); |
1008 | } | 999 | } |
1009 | 1000 | ||
1010 | module_init(iTCO_wdt_init_module); | 1001 | module_init(iTCO_wdt_init_module); |
diff --git a/drivers/watchdog/ib700wdt.c b/drivers/watchdog/ib700wdt.c index 0149d8dfc81d..7df861bfdb2c 100644 --- a/drivers/watchdog/ib700wdt.c +++ b/drivers/watchdog/ib700wdt.c | |||
@@ -31,6 +31,8 @@ | |||
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
35 | |||
34 | #include <linux/module.h> | 36 | #include <linux/module.h> |
35 | #include <linux/types.h> | 37 | #include <linux/types.h> |
36 | #include <linux/miscdevice.h> | 38 | #include <linux/miscdevice.h> |
@@ -53,7 +55,6 @@ static char expect_close; | |||
53 | 55 | ||
54 | /* Module information */ | 56 | /* Module information */ |
55 | #define DRV_NAME "ib700wdt" | 57 | #define DRV_NAME "ib700wdt" |
56 | #define PFX DRV_NAME ": " | ||
57 | 58 | ||
58 | /* | 59 | /* |
59 | * | 60 | * |
@@ -246,8 +247,7 @@ static int ibwdt_close(struct inode *inode, struct file *file) | |||
246 | if (expect_close == 42) { | 247 | if (expect_close == 42) { |
247 | ibwdt_disable(); | 248 | ibwdt_disable(); |
248 | } else { | 249 | } else { |
249 | printk(KERN_CRIT PFX | 250 | pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); |
250 | "WDT device closed unexpectedly. WDT will not stop!\n"); | ||
251 | ibwdt_ping(); | 251 | ibwdt_ping(); |
252 | } | 252 | } |
253 | clear_bit(0, &ibwdt_is_open); | 253 | clear_bit(0, &ibwdt_is_open); |
@@ -284,16 +284,14 @@ static int __devinit ibwdt_probe(struct platform_device *dev) | |||
284 | 284 | ||
285 | #if WDT_START != WDT_STOP | 285 | #if WDT_START != WDT_STOP |
286 | if (!request_region(WDT_STOP, 1, "IB700 WDT")) { | 286 | if (!request_region(WDT_STOP, 1, "IB700 WDT")) { |
287 | printk(KERN_ERR PFX "STOP method I/O %X is not available.\n", | 287 | pr_err("STOP method I/O %X is not available\n", WDT_STOP); |
288 | WDT_STOP); | ||
289 | res = -EIO; | 288 | res = -EIO; |
290 | goto out_nostopreg; | 289 | goto out_nostopreg; |
291 | } | 290 | } |
292 | #endif | 291 | #endif |
293 | 292 | ||
294 | if (!request_region(WDT_START, 1, "IB700 WDT")) { | 293 | if (!request_region(WDT_START, 1, "IB700 WDT")) { |
295 | printk(KERN_ERR PFX "START method I/O %X is not available.\n", | 294 | pr_err("START method I/O %X is not available\n", WDT_START); |
296 | WDT_START); | ||
297 | res = -EIO; | 295 | res = -EIO; |
298 | goto out_nostartreg; | 296 | goto out_nostartreg; |
299 | } | 297 | } |
@@ -302,13 +300,12 @@ static int __devinit ibwdt_probe(struct platform_device *dev) | |||
302 | * if not reset to the default */ | 300 | * if not reset to the default */ |
303 | if (ibwdt_set_heartbeat(timeout)) { | 301 | if (ibwdt_set_heartbeat(timeout)) { |
304 | ibwdt_set_heartbeat(WATCHDOG_TIMEOUT); | 302 | ibwdt_set_heartbeat(WATCHDOG_TIMEOUT); |
305 | printk(KERN_INFO PFX | 303 | pr_info("timeout value must be 0<=x<=30, using %d\n", timeout); |
306 | "timeout value must be 0<=x<=30, using %d\n", timeout); | ||
307 | } | 304 | } |
308 | 305 | ||
309 | res = misc_register(&ibwdt_miscdev); | 306 | res = misc_register(&ibwdt_miscdev); |
310 | if (res) { | 307 | if (res) { |
311 | printk(KERN_ERR PFX "failed to register misc device\n"); | 308 | pr_err("failed to register misc device\n"); |
312 | goto out_nomisc; | 309 | goto out_nomisc; |
313 | } | 310 | } |
314 | return 0; | 311 | return 0; |
@@ -353,8 +350,7 @@ static int __init ibwdt_init(void) | |||
353 | { | 350 | { |
354 | int err; | 351 | int err; |
355 | 352 | ||
356 | printk(KERN_INFO PFX | 353 | pr_info("WDT driver for IB700 single board computer initialising\n"); |
357 | "WDT driver for IB700 single board computer initialising.\n"); | ||
358 | 354 | ||
359 | err = platform_driver_register(&ibwdt_driver); | 355 | err = platform_driver_register(&ibwdt_driver); |
360 | if (err) | 356 | if (err) |
@@ -378,7 +374,7 @@ static void __exit ibwdt_exit(void) | |||
378 | { | 374 | { |
379 | platform_device_unregister(ibwdt_platform_device); | 375 | platform_device_unregister(ibwdt_platform_device); |
380 | platform_driver_unregister(&ibwdt_driver); | 376 | platform_driver_unregister(&ibwdt_driver); |
381 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 377 | pr_info("Watchdog Module Unloaded\n"); |
382 | } | 378 | } |
383 | 379 | ||
384 | module_init(ibwdt_init); | 380 | module_init(ibwdt_init); |
diff --git a/drivers/watchdog/ibmasr.c b/drivers/watchdog/ibmasr.c index c7481ad51629..6cd496915eb0 100644 --- a/drivers/watchdog/ibmasr.c +++ b/drivers/watchdog/ibmasr.c | |||
@@ -10,6 +10,8 @@ | |||
10 | * of the GNU Public License, incorporated herein by reference. | 10 | * of the GNU Public License, incorporated herein by reference. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
14 | |||
13 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
14 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
15 | #include <linux/module.h> | 17 | #include <linux/module.h> |
@@ -31,8 +33,6 @@ enum { | |||
31 | ASMTYPE_SPRUCE, | 33 | ASMTYPE_SPRUCE, |
32 | }; | 34 | }; |
33 | 35 | ||
34 | #define PFX "ibmasr: " | ||
35 | |||
36 | #define TOPAZ_ASR_REG_OFFSET 4 | 36 | #define TOPAZ_ASR_REG_OFFSET 4 |
37 | #define TOPAZ_ASR_TOGGLE 0x40 | 37 | #define TOPAZ_ASR_TOGGLE 0x40 |
38 | #define TOPAZ_ASR_DISABLE 0x80 | 38 | #define TOPAZ_ASR_DISABLE 0x80 |
@@ -234,12 +234,11 @@ static int __init asr_get_base_address(void) | |||
234 | } | 234 | } |
235 | 235 | ||
236 | if (!request_region(asr_base, asr_length, "ibmasr")) { | 236 | if (!request_region(asr_base, asr_length, "ibmasr")) { |
237 | printk(KERN_ERR PFX "address %#x already in use\n", | 237 | pr_err("address %#x already in use\n", asr_base); |
238 | asr_base); | ||
239 | return -EBUSY; | 238 | return -EBUSY; |
240 | } | 239 | } |
241 | 240 | ||
242 | printk(KERN_INFO PFX "found %sASR @ addr %#x\n", type, asr_base); | 241 | pr_info("found %sASR @ addr %#x\n", type, asr_base); |
243 | 242 | ||
244 | return 0; | 243 | return 0; |
245 | } | 244 | } |
@@ -332,8 +331,7 @@ static int asr_release(struct inode *inode, struct file *file) | |||
332 | if (asr_expect_close == 42) | 331 | if (asr_expect_close == 42) |
333 | asr_disable(); | 332 | asr_disable(); |
334 | else { | 333 | else { |
335 | printk(KERN_CRIT PFX | 334 | pr_crit("unexpected close, not stopping watchdog!\n"); |
336 | "unexpected close, not stopping watchdog!\n"); | ||
337 | asr_toggle(); | 335 | asr_toggle(); |
338 | } | 336 | } |
339 | clear_bit(0, &asr_is_open); | 337 | clear_bit(0, &asr_is_open); |
@@ -393,7 +391,7 @@ static int __init ibmasr_init(void) | |||
393 | rc = misc_register(&asr_miscdev); | 391 | rc = misc_register(&asr_miscdev); |
394 | if (rc < 0) { | 392 | if (rc < 0) { |
395 | release_region(asr_base, asr_length); | 393 | release_region(asr_base, asr_length); |
396 | printk(KERN_ERR PFX "failed to register misc device\n"); | 394 | pr_err("failed to register misc device\n"); |
397 | return rc; | 395 | return rc; |
398 | } | 396 | } |
399 | 397 | ||
diff --git a/drivers/watchdog/indydog.c b/drivers/watchdog/indydog.c index 1475e09f9af2..5fa5b2d25e8f 100644 --- a/drivers/watchdog/indydog.c +++ b/drivers/watchdog/indydog.c | |||
@@ -12,6 +12,8 @@ | |||
12 | * based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk> | 12 | * based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk> |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
16 | |||
15 | #include <linux/module.h> | 17 | #include <linux/module.h> |
16 | #include <linux/moduleparam.h> | 18 | #include <linux/moduleparam.h> |
17 | #include <linux/types.h> | 19 | #include <linux/types.h> |
@@ -26,7 +28,6 @@ | |||
26 | #include <linux/uaccess.h> | 28 | #include <linux/uaccess.h> |
27 | #include <asm/sgi/mc.h> | 29 | #include <asm/sgi/mc.h> |
28 | 30 | ||
29 | #define PFX "indydog: " | ||
30 | static unsigned long indydog_alive; | 31 | static unsigned long indydog_alive; |
31 | static DEFINE_SPINLOCK(indydog_lock); | 32 | static DEFINE_SPINLOCK(indydog_lock); |
32 | 33 | ||
@@ -60,7 +61,7 @@ static void indydog_stop(void) | |||
60 | sgimc->cpuctrl0 = mc_ctrl0; | 61 | sgimc->cpuctrl0 = mc_ctrl0; |
61 | spin_unlock(&indydog_lock); | 62 | spin_unlock(&indydog_lock); |
62 | 63 | ||
63 | printk(KERN_INFO PFX "Stopped watchdog timer.\n"); | 64 | pr_info("Stopped watchdog timer\n"); |
64 | } | 65 | } |
65 | 66 | ||
66 | static void indydog_ping(void) | 67 | static void indydog_ping(void) |
@@ -83,7 +84,7 @@ static int indydog_open(struct inode *inode, struct file *file) | |||
83 | indydog_start(); | 84 | indydog_start(); |
84 | indydog_ping(); | 85 | indydog_ping(); |
85 | 86 | ||
86 | printk(KERN_INFO "Started watchdog timer.\n"); | 87 | pr_info("Started watchdog timer\n"); |
87 | 88 | ||
88 | return nonseekable_open(inode, file); | 89 | return nonseekable_open(inode, file); |
89 | } | 90 | } |
@@ -178,30 +179,25 @@ static struct notifier_block indydog_notifier = { | |||
178 | .notifier_call = indydog_notify_sys, | 179 | .notifier_call = indydog_notify_sys, |
179 | }; | 180 | }; |
180 | 181 | ||
181 | static char banner[] __initdata = | ||
182 | KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n"; | ||
183 | |||
184 | static int __init watchdog_init(void) | 182 | static int __init watchdog_init(void) |
185 | { | 183 | { |
186 | int ret; | 184 | int ret; |
187 | 185 | ||
188 | ret = register_reboot_notifier(&indydog_notifier); | 186 | ret = register_reboot_notifier(&indydog_notifier); |
189 | if (ret) { | 187 | if (ret) { |
190 | printk(KERN_ERR PFX | 188 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
191 | "cannot register reboot notifier (err=%d)\n", ret); | ||
192 | return ret; | 189 | return ret; |
193 | } | 190 | } |
194 | 191 | ||
195 | ret = misc_register(&indydog_miscdev); | 192 | ret = misc_register(&indydog_miscdev); |
196 | if (ret) { | 193 | if (ret) { |
197 | printk(KERN_ERR PFX | 194 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
198 | "cannot register miscdev on minor=%d (err=%d)\n", | 195 | WATCHDOG_MINOR, ret); |
199 | WATCHDOG_MINOR, ret); | ||
200 | unregister_reboot_notifier(&indydog_notifier); | 196 | unregister_reboot_notifier(&indydog_notifier); |
201 | return ret; | 197 | return ret; |
202 | } | 198 | } |
203 | 199 | ||
204 | printk(banner); | 200 | pr_info("Hardware Watchdog Timer for SGI IP22: 0.3\n"); |
205 | 201 | ||
206 | return 0; | 202 | return 0; |
207 | } | 203 | } |
diff --git a/drivers/watchdog/intel_scu_watchdog.c b/drivers/watchdog/intel_scu_watchdog.c index 1abdc0454c54..9dda2d08af91 100644 --- a/drivers/watchdog/intel_scu_watchdog.c +++ b/drivers/watchdog/intel_scu_watchdog.c | |||
@@ -22,6 +22,8 @@ | |||
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | 24 | ||
25 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
26 | |||
25 | #include <linux/compiler.h> | 27 | #include <linux/compiler.h> |
26 | #include <linux/module.h> | 28 | #include <linux/module.h> |
27 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
@@ -96,15 +98,14 @@ static struct intel_scu_watchdog_dev watchdog_device; | |||
96 | static void watchdog_fire(void) | 98 | static void watchdog_fire(void) |
97 | { | 99 | { |
98 | if (force_boot) { | 100 | if (force_boot) { |
99 | printk(KERN_CRIT PFX "Initiating system reboot.\n"); | 101 | pr_crit("Initiating system reboot\n"); |
100 | emergency_restart(); | 102 | emergency_restart(); |
101 | printk(KERN_CRIT PFX "Reboot didn't ?????\n"); | 103 | pr_crit("Reboot didn't ?????\n"); |
102 | } | 104 | } |
103 | 105 | ||
104 | else { | 106 | else { |
105 | printk(KERN_CRIT PFX "Immediate Reboot Disabled\n"); | 107 | pr_crit("Immediate Reboot Disabled\n"); |
106 | printk(KERN_CRIT PFX | 108 | pr_crit("System will reset when watchdog timer times out!\n"); |
107 | "System will reset when watchdog timer times out!\n"); | ||
108 | } | 109 | } |
109 | } | 110 | } |
110 | 111 | ||
@@ -112,8 +113,8 @@ static int check_timer_margin(int new_margin) | |||
112 | { | 113 | { |
113 | if ((new_margin < MIN_TIME_CYCLE) || | 114 | if ((new_margin < MIN_TIME_CYCLE) || |
114 | (new_margin > MAX_TIME - timer_set)) { | 115 | (new_margin > MAX_TIME - timer_set)) { |
115 | pr_debug("Watchdog timer: value of new_margin %d is out of the range %d to %d\n", | 116 | pr_debug("value of new_margin %d is out of the range %d to %d\n", |
116 | new_margin, MIN_TIME_CYCLE, MAX_TIME - timer_set); | 117 | new_margin, MIN_TIME_CYCLE, MAX_TIME - timer_set); |
117 | return -EINVAL; | 118 | return -EINVAL; |
118 | } | 119 | } |
119 | return 0; | 120 | return 0; |
@@ -156,14 +157,14 @@ static irqreturn_t watchdog_timer_interrupt(int irq, void *dev_id) | |||
156 | int int_status; | 157 | int int_status; |
157 | int_status = ioread32(watchdog_device.timer_interrupt_status_addr); | 158 | int_status = ioread32(watchdog_device.timer_interrupt_status_addr); |
158 | 159 | ||
159 | pr_debug("Watchdog timer: irq, int_status: %x\n", int_status); | 160 | pr_debug("irq, int_status: %x\n", int_status); |
160 | 161 | ||
161 | if (int_status != 0) | 162 | if (int_status != 0) |
162 | return IRQ_NONE; | 163 | return IRQ_NONE; |
163 | 164 | ||
164 | /* has the timer been started? If not, then this is spurious */ | 165 | /* has the timer been started? If not, then this is spurious */ |
165 | if (watchdog_device.timer_started == 0) { | 166 | if (watchdog_device.timer_started == 0) { |
166 | pr_debug("Watchdog timer: spurious interrupt received\n"); | 167 | pr_debug("spurious interrupt received\n"); |
167 | return IRQ_HANDLED; | 168 | return IRQ_HANDLED; |
168 | } | 169 | } |
169 | 170 | ||
@@ -220,16 +221,15 @@ static int intel_scu_set_heartbeat(u32 t) | |||
220 | (watchdog_device.timer_set - timer_margin) | 221 | (watchdog_device.timer_set - timer_margin) |
221 | * watchdog_device.timer_tbl_ptr->freq_hz; | 222 | * watchdog_device.timer_tbl_ptr->freq_hz; |
222 | 223 | ||
223 | pr_debug("Watchdog timer: set_heartbeat: timer freq is %d\n", | 224 | pr_debug("set_heartbeat: timer freq is %d\n", |
224 | watchdog_device.timer_tbl_ptr->freq_hz); | 225 | watchdog_device.timer_tbl_ptr->freq_hz); |
225 | pr_debug("Watchdog timer: set_heartbeat: timer_set is %x (hex)\n", | 226 | pr_debug("set_heartbeat: timer_set is %x (hex)\n", |
226 | watchdog_device.timer_set); | 227 | watchdog_device.timer_set); |
227 | pr_debug("Watchdog timer: set_hearbeat: timer_margin is %x (hex)\n", | 228 | pr_debug("set_hearbeat: timer_margin is %x (hex)\n", timer_margin); |
228 | timer_margin); | 229 | pr_debug("set_heartbeat: threshold is %x (hex)\n", |
229 | pr_debug("Watchdog timer: set_heartbeat: threshold is %x (hex)\n", | 230 | watchdog_device.threshold); |
230 | watchdog_device.threshold); | 231 | pr_debug("set_heartbeat: soft_threshold is %x (hex)\n", |
231 | pr_debug("Watchdog timer: set_heartbeat: soft_threshold is %x (hex)\n", | 232 | watchdog_device.soft_threshold); |
232 | watchdog_device.soft_threshold); | ||
233 | 233 | ||
234 | /* Adjust thresholds by FREQ_ADJUSTMENT factor, to make the */ | 234 | /* Adjust thresholds by FREQ_ADJUSTMENT factor, to make the */ |
235 | /* watchdog timing come out right. */ | 235 | /* watchdog timing come out right. */ |
@@ -264,7 +264,7 @@ static int intel_scu_set_heartbeat(u32 t) | |||
264 | 264 | ||
265 | if (MAX_RETRY < retry_count++) { | 265 | if (MAX_RETRY < retry_count++) { |
266 | /* Unable to set timer value */ | 266 | /* Unable to set timer value */ |
267 | pr_err("Watchdog timer: Unable to set timer\n"); | 267 | pr_err("Unable to set timer\n"); |
268 | return -ENODEV; | 268 | return -ENODEV; |
269 | } | 269 | } |
270 | 270 | ||
@@ -321,18 +321,17 @@ static int intel_scu_release(struct inode *inode, struct file *file) | |||
321 | */ | 321 | */ |
322 | 322 | ||
323 | if (!test_and_clear_bit(0, &watchdog_device.driver_open)) { | 323 | if (!test_and_clear_bit(0, &watchdog_device.driver_open)) { |
324 | pr_debug("Watchdog timer: intel_scu_release, without open\n"); | 324 | pr_debug("intel_scu_release, without open\n"); |
325 | return -ENOTTY; | 325 | return -ENOTTY; |
326 | } | 326 | } |
327 | 327 | ||
328 | if (!watchdog_device.timer_started) { | 328 | if (!watchdog_device.timer_started) { |
329 | /* Just close, since timer has not been started */ | 329 | /* Just close, since timer has not been started */ |
330 | pr_debug("Watchdog timer: closed, without starting timer\n"); | 330 | pr_debug("closed, without starting timer\n"); |
331 | return 0; | 331 | return 0; |
332 | } | 332 | } |
333 | 333 | ||
334 | printk(KERN_CRIT PFX | 334 | pr_crit("Unexpected close of /dev/watchdog!\n"); |
335 | "Unexpected close of /dev/watchdog!\n"); | ||
336 | 335 | ||
337 | /* Since the timer was started, prevent future reopens */ | 336 | /* Since the timer was started, prevent future reopens */ |
338 | watchdog_device.driver_closed = 1; | 337 | watchdog_device.driver_closed = 1; |
@@ -454,9 +453,8 @@ static int __init intel_scu_watchdog_init(void) | |||
454 | /* Check value of timer_set boot parameter */ | 453 | /* Check value of timer_set boot parameter */ |
455 | if ((timer_set < MIN_TIME_CYCLE) || | 454 | if ((timer_set < MIN_TIME_CYCLE) || |
456 | (timer_set > MAX_TIME - MIN_TIME_CYCLE)) { | 455 | (timer_set > MAX_TIME - MIN_TIME_CYCLE)) { |
457 | pr_err("Watchdog timer: value of timer_set %x (hex) " | 456 | pr_err("value of timer_set %x (hex) is out of range from %x to %x (hex)\n", |
458 | "is out of range from %x to %x (hex)\n", | 457 | timer_set, MIN_TIME_CYCLE, MAX_TIME - MIN_TIME_CYCLE); |
459 | timer_set, MIN_TIME_CYCLE, MAX_TIME - MIN_TIME_CYCLE); | ||
460 | return -EINVAL; | 458 | return -EINVAL; |
461 | } | 459 | } |
462 | 460 | ||
@@ -467,19 +465,18 @@ static int __init intel_scu_watchdog_init(void) | |||
467 | watchdog_device.timer_tbl_ptr = sfi_get_mtmr(sfi_mtimer_num-1); | 465 | watchdog_device.timer_tbl_ptr = sfi_get_mtmr(sfi_mtimer_num-1); |
468 | 466 | ||
469 | if (watchdog_device.timer_tbl_ptr == NULL) { | 467 | if (watchdog_device.timer_tbl_ptr == NULL) { |
470 | pr_debug("Watchdog timer - Intel SCU watchdog: timer is not available\n"); | 468 | pr_debug("timer is not available\n"); |
471 | return -ENODEV; | 469 | return -ENODEV; |
472 | } | 470 | } |
473 | /* make sure the timer exists */ | 471 | /* make sure the timer exists */ |
474 | if (watchdog_device.timer_tbl_ptr->phys_addr == 0) { | 472 | if (watchdog_device.timer_tbl_ptr->phys_addr == 0) { |
475 | pr_debug("Watchdog timer - Intel SCU watchdog - timer %d does not have valid physical memory\n", | 473 | pr_debug("timer %d does not have valid physical memory\n", |
476 | sfi_mtimer_num); | 474 | sfi_mtimer_num); |
477 | return -ENODEV; | 475 | return -ENODEV; |
478 | } | 476 | } |
479 | 477 | ||
480 | if (watchdog_device.timer_tbl_ptr->irq == 0) { | 478 | if (watchdog_device.timer_tbl_ptr->irq == 0) { |
481 | pr_debug("Watchdog timer: timer %d invalid irq\n", | 479 | pr_debug("timer %d invalid irq\n", sfi_mtimer_num); |
482 | sfi_mtimer_num); | ||
483 | return -ENODEV; | 480 | return -ENODEV; |
484 | } | 481 | } |
485 | 482 | ||
@@ -487,7 +484,7 @@ static int __init intel_scu_watchdog_init(void) | |||
487 | 20); | 484 | 20); |
488 | 485 | ||
489 | if (tmp_addr == NULL) { | 486 | if (tmp_addr == NULL) { |
490 | pr_debug("Watchdog timer: timer unable to ioremap\n"); | 487 | pr_debug("timer unable to ioremap\n"); |
491 | return -ENOMEM; | 488 | return -ENOMEM; |
492 | } | 489 | } |
493 | 490 | ||
@@ -512,7 +509,7 @@ static int __init intel_scu_watchdog_init(void) | |||
512 | 509 | ||
513 | ret = register_reboot_notifier(&watchdog_device.intel_scu_notifier); | 510 | ret = register_reboot_notifier(&watchdog_device.intel_scu_notifier); |
514 | if (ret) { | 511 | if (ret) { |
515 | pr_err("Watchdog timer: cannot register notifier %d)\n", ret); | 512 | pr_err("cannot register notifier %d)\n", ret); |
516 | goto register_reboot_error; | 513 | goto register_reboot_error; |
517 | } | 514 | } |
518 | 515 | ||
@@ -522,8 +519,8 @@ static int __init intel_scu_watchdog_init(void) | |||
522 | 519 | ||
523 | ret = misc_register(&watchdog_device.miscdev); | 520 | ret = misc_register(&watchdog_device.miscdev); |
524 | if (ret) { | 521 | if (ret) { |
525 | pr_err("Watchdog timer: cannot register miscdev %d err =%d\n", | 522 | pr_err("cannot register miscdev %d err =%d\n", |
526 | WATCHDOG_MINOR, ret); | 523 | WATCHDOG_MINOR, ret); |
527 | goto misc_register_error; | 524 | goto misc_register_error; |
528 | } | 525 | } |
529 | 526 | ||
@@ -532,7 +529,7 @@ static int __init intel_scu_watchdog_init(void) | |||
532 | IRQF_SHARED, "watchdog", | 529 | IRQF_SHARED, "watchdog", |
533 | &watchdog_device.timer_load_count_addr); | 530 | &watchdog_device.timer_load_count_addr); |
534 | if (ret) { | 531 | if (ret) { |
535 | pr_err("Watchdog timer: error requesting irq %d\n", ret); | 532 | pr_err("error requesting irq %d\n", ret); |
536 | goto request_irq_error; | 533 | goto request_irq_error; |
537 | } | 534 | } |
538 | /* Make sure timer is disabled before returning */ | 535 | /* Make sure timer is disabled before returning */ |
diff --git a/drivers/watchdog/intel_scu_watchdog.h b/drivers/watchdog/intel_scu_watchdog.h index d2b074a82db6..f3ac608deb6a 100644 --- a/drivers/watchdog/intel_scu_watchdog.h +++ b/drivers/watchdog/intel_scu_watchdog.h | |||
@@ -25,7 +25,6 @@ | |||
25 | #ifndef __INTEL_SCU_WATCHDOG_H | 25 | #ifndef __INTEL_SCU_WATCHDOG_H |
26 | #define __INTEL_SCU_WATCHDOG_H | 26 | #define __INTEL_SCU_WATCHDOG_H |
27 | 27 | ||
28 | #define PFX "Intel_SCU: " | ||
29 | #define WDT_VER "0.3" | 28 | #define WDT_VER "0.3" |
30 | 29 | ||
31 | /* minimum time between interrupts */ | 30 | /* minimum time between interrupts */ |
diff --git a/drivers/watchdog/iop_wdt.c b/drivers/watchdog/iop_wdt.c index 82fa7a92a8d2..add259b1887c 100644 --- a/drivers/watchdog/iop_wdt.c +++ b/drivers/watchdog/iop_wdt.c | |||
@@ -24,6 +24,8 @@ | |||
24 | * Dan Williams <dan.j.williams@intel.com> | 24 | * Dan Williams <dan.j.williams@intel.com> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
28 | |||
27 | #include <linux/module.h> | 29 | #include <linux/module.h> |
28 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
29 | #include <linux/fs.h> | 31 | #include <linux/fs.h> |
@@ -85,7 +87,7 @@ static int wdt_disable(void) | |||
85 | write_wdtcr(IOP_WDTCR_DIS); | 87 | write_wdtcr(IOP_WDTCR_DIS); |
86 | clear_bit(WDT_ENABLED, &wdt_status); | 88 | clear_bit(WDT_ENABLED, &wdt_status); |
87 | spin_unlock(&wdt_lock); | 89 | spin_unlock(&wdt_lock); |
88 | printk(KERN_INFO "WATCHDOG: Disabled\n"); | 90 | pr_info("Disabled\n"); |
89 | return 0; | 91 | return 0; |
90 | } else | 92 | } else |
91 | return 1; | 93 | return 1; |
@@ -197,8 +199,8 @@ static int iop_wdt_release(struct inode *inode, struct file *file) | |||
197 | */ | 199 | */ |
198 | if (state != 0) { | 200 | if (state != 0) { |
199 | wdt_enable(); | 201 | wdt_enable(); |
200 | printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " | 202 | pr_crit("Device closed unexpectedly - reset in %lu seconds\n", |
201 | "reset in %lu seconds\n", iop_watchdog_timeout()); | 203 | iop_watchdog_timeout()); |
202 | } | 204 | } |
203 | 205 | ||
204 | clear_bit(WDT_IN_USE, &wdt_status); | 206 | clear_bit(WDT_IN_USE, &wdt_status); |
@@ -238,8 +240,7 @@ static int __init iop_wdt_init(void) | |||
238 | with an open */ | 240 | with an open */ |
239 | ret = misc_register(&iop_wdt_miscdev); | 241 | ret = misc_register(&iop_wdt_miscdev); |
240 | if (ret == 0) | 242 | if (ret == 0) |
241 | printk(KERN_INFO "iop watchdog timer: timeout %lu sec\n", | 243 | pr_info("timeout %lu sec\n", iop_watchdog_timeout()); |
242 | iop_watchdog_timeout()); | ||
243 | 244 | ||
244 | return ret; | 245 | return ret; |
245 | } | 246 | } |
diff --git a/drivers/watchdog/it8712f_wdt.c b/drivers/watchdog/it8712f_wdt.c index 8d2d8502d3e8..ebd1793b9565 100644 --- a/drivers/watchdog/it8712f_wdt.c +++ b/drivers/watchdog/it8712f_wdt.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * software is provided AS-IS with no warranties. | 20 | * software is provided AS-IS with no warranties. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
23 | #include <linux/module.h> | 25 | #include <linux/module.h> |
24 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
25 | #include <linux/init.h> | 27 | #include <linux/init.h> |
@@ -33,6 +35,7 @@ | |||
33 | #include <linux/io.h> | 35 | #include <linux/io.h> |
34 | #include <linux/ioport.h> | 36 | #include <linux/ioport.h> |
35 | 37 | ||
38 | #define DEBUG | ||
36 | #define NAME "it8712f_wdt" | 39 | #define NAME "it8712f_wdt" |
37 | 40 | ||
38 | MODULE_AUTHOR("Jorge Boncompte - DTI2 <jorge@dti2.net>"); | 41 | MODULE_AUTHOR("Jorge Boncompte - DTI2 <jorge@dti2.net>"); |
@@ -158,10 +161,10 @@ static void it8712f_wdt_update_margin(void) | |||
158 | */ | 161 | */ |
159 | if (units <= max_units) { | 162 | if (units <= max_units) { |
160 | config |= WDT_UNIT_SEC; /* else UNIT is MINUTES */ | 163 | config |= WDT_UNIT_SEC; /* else UNIT is MINUTES */ |
161 | printk(KERN_INFO NAME ": timer margin %d seconds\n", units); | 164 | pr_info("timer margin %d seconds\n", units); |
162 | } else { | 165 | } else { |
163 | units /= 60; | 166 | units /= 60; |
164 | printk(KERN_INFO NAME ": timer margin %d minutes\n", units); | 167 | pr_info("timer margin %d minutes\n", units); |
165 | } | 168 | } |
166 | superio_outb(config, WDT_CONFIG); | 169 | superio_outb(config, WDT_CONFIG); |
167 | 170 | ||
@@ -184,7 +187,7 @@ static int it8712f_wdt_enable(void) | |||
184 | if (ret) | 187 | if (ret) |
185 | return ret; | 188 | return ret; |
186 | 189 | ||
187 | printk(KERN_DEBUG NAME ": enabling watchdog timer\n"); | 190 | pr_debug("enabling watchdog timer\n"); |
188 | superio_select(LDN_GPIO); | 191 | superio_select(LDN_GPIO); |
189 | 192 | ||
190 | superio_outb(wdt_control_reg, WDT_CONTROL); | 193 | superio_outb(wdt_control_reg, WDT_CONTROL); |
@@ -204,7 +207,7 @@ static int it8712f_wdt_disable(void) | |||
204 | if (ret) | 207 | if (ret) |
205 | return ret; | 208 | return ret; |
206 | 209 | ||
207 | printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); | 210 | pr_debug("disabling watchdog timer\n"); |
208 | superio_select(LDN_GPIO); | 211 | superio_select(LDN_GPIO); |
209 | 212 | ||
210 | superio_outb(0, WDT_CONFIG); | 213 | superio_outb(0, WDT_CONFIG); |
@@ -331,12 +334,10 @@ static int it8712f_wdt_open(struct inode *inode, struct file *file) | |||
331 | static int it8712f_wdt_release(struct inode *inode, struct file *file) | 334 | static int it8712f_wdt_release(struct inode *inode, struct file *file) |
332 | { | 335 | { |
333 | if (expect_close != 42) { | 336 | if (expect_close != 42) { |
334 | printk(KERN_WARNING NAME | 337 | pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n"); |
335 | ": watchdog device closed unexpectedly, will not" | ||
336 | " disable the watchdog timer\n"); | ||
337 | } else if (!nowayout) { | 338 | } else if (!nowayout) { |
338 | if (it8712f_wdt_disable()) | 339 | if (it8712f_wdt_disable()) |
339 | printk(KERN_WARNING NAME "Watchdog disable failed\n"); | 340 | pr_warn("Watchdog disable failed\n"); |
340 | } | 341 | } |
341 | expect_close = 0; | 342 | expect_close = 0; |
342 | clear_bit(0, &wdt_open); | 343 | clear_bit(0, &wdt_open); |
@@ -374,13 +375,13 @@ static int __init it8712f_wdt_find(unsigned short *address) | |||
374 | superio_select(LDN_GAME); | 375 | superio_select(LDN_GAME); |
375 | superio_outb(1, ACT_REG); | 376 | superio_outb(1, ACT_REG); |
376 | if (!(superio_inb(ACT_REG) & 0x01)) { | 377 | if (!(superio_inb(ACT_REG) & 0x01)) { |
377 | printk(KERN_ERR NAME ": Device not activated, skipping\n"); | 378 | pr_err("Device not activated, skipping\n"); |
378 | goto exit; | 379 | goto exit; |
379 | } | 380 | } |
380 | 381 | ||
381 | *address = superio_inw(BASE_REG); | 382 | *address = superio_inw(BASE_REG); |
382 | if (*address == 0) { | 383 | if (*address == 0) { |
383 | printk(KERN_ERR NAME ": Base address not set, skipping\n"); | 384 | pr_err("Base address not set, skipping\n"); |
384 | goto exit; | 385 | goto exit; |
385 | } | 386 | } |
386 | 387 | ||
@@ -394,8 +395,7 @@ static int __init it8712f_wdt_find(unsigned short *address) | |||
394 | if (margin > (max_units * 60)) | 395 | if (margin > (max_units * 60)) |
395 | margin = (max_units * 60); | 396 | margin = (max_units * 60); |
396 | 397 | ||
397 | printk(KERN_INFO NAME ": Found IT%04xF chip revision %d - " | 398 | pr_info("Found IT%04xF chip revision %d - using DogFood address 0x%x\n", |
398 | "using DogFood address 0x%x\n", | ||
399 | chip_type, revision, *address); | 399 | chip_type, revision, *address); |
400 | 400 | ||
401 | exit: | 401 | exit: |
@@ -411,27 +411,26 @@ static int __init it8712f_wdt_init(void) | |||
411 | return -ENODEV; | 411 | return -ENODEV; |
412 | 412 | ||
413 | if (!request_region(address, 1, "IT8712F Watchdog")) { | 413 | if (!request_region(address, 1, "IT8712F Watchdog")) { |
414 | printk(KERN_WARNING NAME ": watchdog I/O region busy\n"); | 414 | pr_warn("watchdog I/O region busy\n"); |
415 | return -EBUSY; | 415 | return -EBUSY; |
416 | } | 416 | } |
417 | 417 | ||
418 | err = it8712f_wdt_disable(); | 418 | err = it8712f_wdt_disable(); |
419 | if (err) { | 419 | if (err) { |
420 | printk(KERN_ERR NAME ": unable to disable watchdog timer.\n"); | 420 | pr_err("unable to disable watchdog timer\n"); |
421 | goto out; | 421 | goto out; |
422 | } | 422 | } |
423 | 423 | ||
424 | err = register_reboot_notifier(&it8712f_wdt_notifier); | 424 | err = register_reboot_notifier(&it8712f_wdt_notifier); |
425 | if (err) { | 425 | if (err) { |
426 | printk(KERN_ERR NAME ": unable to register reboot notifier\n"); | 426 | pr_err("unable to register reboot notifier\n"); |
427 | goto out; | 427 | goto out; |
428 | } | 428 | } |
429 | 429 | ||
430 | err = misc_register(&it8712f_wdt_miscdev); | 430 | err = misc_register(&it8712f_wdt_miscdev); |
431 | if (err) { | 431 | if (err) { |
432 | printk(KERN_ERR NAME | 432 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
433 | ": cannot register miscdev on minor=%d (err=%d)\n", | 433 | WATCHDOG_MINOR, err); |
434 | WATCHDOG_MINOR, err); | ||
435 | goto reboot_out; | 434 | goto reboot_out; |
436 | } | 435 | } |
437 | 436 | ||
diff --git a/drivers/watchdog/it87_wdt.c b/drivers/watchdog/it87_wdt.c index a2d9a1266a23..86b368857ce2 100644 --- a/drivers/watchdog/it87_wdt.c +++ b/drivers/watchdog/it87_wdt.c | |||
@@ -29,6 +29,8 @@ | |||
29 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 29 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
33 | |||
32 | #include <linux/module.h> | 34 | #include <linux/module.h> |
33 | #include <linux/moduleparam.h> | 35 | #include <linux/moduleparam.h> |
34 | #include <linux/types.h> | 36 | #include <linux/types.h> |
@@ -47,7 +49,6 @@ | |||
47 | 49 | ||
48 | #define WATCHDOG_VERSION "1.14" | 50 | #define WATCHDOG_VERSION "1.14" |
49 | #define WATCHDOG_NAME "IT87 WDT" | 51 | #define WATCHDOG_NAME "IT87 WDT" |
50 | #define PFX WATCHDOG_NAME ": " | ||
51 | #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" | 52 | #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" |
52 | #define WD_MAGIC 'V' | 53 | #define WD_MAGIC 'V' |
53 | 54 | ||
@@ -428,8 +429,7 @@ static int wdt_release(struct inode *inode, struct file *file) | |||
428 | clear_bit(WDTS_TIMER_RUN, &wdt_status); | 429 | clear_bit(WDTS_TIMER_RUN, &wdt_status); |
429 | } else { | 430 | } else { |
430 | wdt_keepalive(); | 431 | wdt_keepalive(); |
431 | printk(KERN_CRIT PFX | 432 | pr_crit("unexpected close, not stopping watchdog!\n"); |
432 | "unexpected close, not stopping watchdog!\n"); | ||
433 | } | 433 | } |
434 | } | 434 | } |
435 | clear_bit(WDTS_DEV_OPEN, &wdt_status); | 435 | clear_bit(WDTS_DEV_OPEN, &wdt_status); |
@@ -621,16 +621,14 @@ static int __init it87_wdt_init(void) | |||
621 | try_gameport = 0; | 621 | try_gameport = 0; |
622 | break; | 622 | break; |
623 | case IT8705_ID: | 623 | case IT8705_ID: |
624 | printk(KERN_ERR PFX | 624 | pr_err("Unsupported Chip found, Chip %04x Revision %02x\n", |
625 | "Unsupported Chip found, Chip %04x Revision %02x\n", | ||
626 | chip_type, chip_rev); | 625 | chip_type, chip_rev); |
627 | return -ENODEV; | 626 | return -ENODEV; |
628 | case NO_DEV_ID: | 627 | case NO_DEV_ID: |
629 | printk(KERN_ERR PFX "no device\n"); | 628 | pr_err("no device\n"); |
630 | return -ENODEV; | 629 | return -ENODEV; |
631 | default: | 630 | default: |
632 | printk(KERN_ERR PFX | 631 | pr_err("Unknown Chip found, Chip %04x Revision %04x\n", |
633 | "Unknown Chip found, Chip %04x Revision %04x\n", | ||
634 | chip_type, chip_rev); | 632 | chip_type, chip_rev); |
635 | return -ENODEV; | 633 | return -ENODEV; |
636 | } | 634 | } |
@@ -663,13 +661,11 @@ static int __init it87_wdt_init(void) | |||
663 | if (!test_bit(WDTS_USE_GP, &wdt_status)) { | 661 | if (!test_bit(WDTS_USE_GP, &wdt_status)) { |
664 | if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) { | 662 | if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) { |
665 | if (gp_rreq_fail) | 663 | if (gp_rreq_fail) |
666 | printk(KERN_ERR PFX | 664 | pr_err("I/O Address 0x%04x and 0x%04x already in use\n", |
667 | "I/O Address 0x%04x and 0x%04x" | 665 | base, CIR_BASE); |
668 | " already in use\n", base, CIR_BASE); | ||
669 | else | 666 | else |
670 | printk(KERN_ERR PFX | 667 | pr_err("I/O Address 0x%04x already in use\n", |
671 | "I/O Address 0x%04x already in use\n", | 668 | CIR_BASE); |
672 | CIR_BASE); | ||
673 | rc = -EIO; | 669 | rc = -EIO; |
674 | goto err_out; | 670 | goto err_out; |
675 | } | 671 | } |
@@ -688,9 +684,8 @@ static int __init it87_wdt_init(void) | |||
688 | 684 | ||
689 | if (timeout < 1 || timeout > max_units * 60) { | 685 | if (timeout < 1 || timeout > max_units * 60) { |
690 | timeout = DEFAULT_TIMEOUT; | 686 | timeout = DEFAULT_TIMEOUT; |
691 | printk(KERN_WARNING PFX | 687 | pr_warn("Timeout value out of range, use default %d sec\n", |
692 | "Timeout value out of range, use default %d sec\n", | 688 | DEFAULT_TIMEOUT); |
693 | DEFAULT_TIMEOUT); | ||
694 | } | 689 | } |
695 | 690 | ||
696 | if (timeout > max_units) | 691 | if (timeout > max_units) |
@@ -698,16 +693,14 @@ static int __init it87_wdt_init(void) | |||
698 | 693 | ||
699 | rc = register_reboot_notifier(&wdt_notifier); | 694 | rc = register_reboot_notifier(&wdt_notifier); |
700 | if (rc) { | 695 | if (rc) { |
701 | printk(KERN_ERR PFX | 696 | pr_err("Cannot register reboot notifier (err=%d)\n", rc); |
702 | "Cannot register reboot notifier (err=%d)\n", rc); | ||
703 | goto err_out_region; | 697 | goto err_out_region; |
704 | } | 698 | } |
705 | 699 | ||
706 | rc = misc_register(&wdt_miscdev); | 700 | rc = misc_register(&wdt_miscdev); |
707 | if (rc) { | 701 | if (rc) { |
708 | printk(KERN_ERR PFX | 702 | pr_err("Cannot register miscdev on minor=%d (err=%d)\n", |
709 | "Cannot register miscdev on minor=%d (err=%d)\n", | 703 | wdt_miscdev.minor, rc); |
710 | wdt_miscdev.minor, rc); | ||
711 | goto err_out_reboot; | 704 | goto err_out_reboot; |
712 | } | 705 | } |
713 | 706 | ||
@@ -722,9 +715,8 @@ static int __init it87_wdt_init(void) | |||
722 | outb(0x09, CIR_IER(base)); | 715 | outb(0x09, CIR_IER(base)); |
723 | } | 716 | } |
724 | 717 | ||
725 | printk(KERN_INFO PFX "Chip IT%04x revision %d initialized. " | 718 | pr_info("Chip IT%04x revision %d initialized. timeout=%d sec (nowayout=%d testmode=%d exclusive=%d nogameport=%d)\n", |
726 | "timeout=%d sec (nowayout=%d testmode=%d exclusive=%d " | 719 | chip_type, chip_rev, timeout, |
727 | "nogameport=%d)\n", chip_type, chip_rev, timeout, | ||
728 | nowayout, testmode, exclusive, nogameport); | 720 | nowayout, testmode, exclusive, nogameport); |
729 | 721 | ||
730 | superio_exit(); | 722 | superio_exit(); |
diff --git a/drivers/watchdog/ixp2000_wdt.c b/drivers/watchdog/ixp2000_wdt.c index 084f71aa855a..fc603c5558fc 100644 --- a/drivers/watchdog/ixp2000_wdt.c +++ b/drivers/watchdog/ixp2000_wdt.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * warranty of any kind, whether express or implied. | 16 | * warranty of any kind, whether express or implied. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
20 | |||
19 | #include <linux/module.h> | 21 | #include <linux/module.h> |
20 | #include <linux/moduleparam.h> | 22 | #include <linux/moduleparam.h> |
21 | #include <linux/types.h> | 23 | #include <linux/types.h> |
@@ -158,8 +160,7 @@ static int ixp2000_wdt_release(struct inode *inode, struct file *file) | |||
158 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) | 160 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) |
159 | wdt_disable(); | 161 | wdt_disable(); |
160 | else | 162 | else |
161 | printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " | 163 | pr_crit("Device closed unexpectedly - timer will not stop\n"); |
162 | "timer will not stop\n"); | ||
163 | clear_bit(WDT_IN_USE, &wdt_status); | 164 | clear_bit(WDT_IN_USE, &wdt_status); |
164 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); | 165 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); |
165 | 166 | ||
@@ -185,7 +186,7 @@ static struct miscdevice ixp2000_wdt_miscdev = { | |||
185 | static int __init ixp2000_wdt_init(void) | 186 | static int __init ixp2000_wdt_init(void) |
186 | { | 187 | { |
187 | if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) { | 188 | if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) { |
188 | printk(KERN_INFO "Unable to use IXP2000 watchdog due to IXP2800 erratum #25.\n"); | 189 | pr_info("Unable to use IXP2000 watchdog due to IXP2800 erratum #25\n"); |
189 | return -EIO; | 190 | return -EIO; |
190 | } | 191 | } |
191 | wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256; | 192 | wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256; |
diff --git a/drivers/watchdog/ixp4xx_wdt.c b/drivers/watchdog/ixp4xx_wdt.c index 4fc2e9ac26f7..792f95cfac85 100644 --- a/drivers/watchdog/ixp4xx_wdt.c +++ b/drivers/watchdog/ixp4xx_wdt.c | |||
@@ -13,6 +13,8 @@ | |||
13 | * warranty of any kind, whether express or implied. | 13 | * warranty of any kind, whether express or implied. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
17 | |||
16 | #include <linux/module.h> | 18 | #include <linux/module.h> |
17 | #include <linux/moduleparam.h> | 19 | #include <linux/moduleparam.h> |
18 | #include <linux/types.h> | 20 | #include <linux/types.h> |
@@ -147,8 +149,7 @@ static int ixp4xx_wdt_release(struct inode *inode, struct file *file) | |||
147 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) | 149 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) |
148 | wdt_disable(); | 150 | wdt_disable(); |
149 | else | 151 | else |
150 | printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " | 152 | pr_crit("Device closed unexpectedly - timer will not stop\n"); |
151 | "timer will not stop\n"); | ||
152 | clear_bit(WDT_IN_USE, &wdt_status); | 153 | clear_bit(WDT_IN_USE, &wdt_status); |
153 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); | 154 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); |
154 | 155 | ||
@@ -176,8 +177,7 @@ static int __init ixp4xx_wdt_init(void) | |||
176 | int ret; | 177 | int ret; |
177 | 178 | ||
178 | if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) { | 179 | if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) { |
179 | printk(KERN_ERR "IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected" | 180 | pr_err("Rev. A0 IXP42x CPU detected - watchdog disabled\n"); |
180 | " - watchdog disabled\n"); | ||
181 | 181 | ||
182 | return -ENODEV; | 182 | return -ENODEV; |
183 | } | 183 | } |
@@ -185,8 +185,7 @@ static int __init ixp4xx_wdt_init(void) | |||
185 | WDIOF_CARDRESET : 0; | 185 | WDIOF_CARDRESET : 0; |
186 | ret = misc_register(&ixp4xx_wdt_miscdev); | 186 | ret = misc_register(&ixp4xx_wdt_miscdev); |
187 | if (ret == 0) | 187 | if (ret == 0) |
188 | printk(KERN_INFO "IXP4xx Watchdog Timer: heartbeat %d sec\n", | 188 | pr_info("timer heartbeat %d sec\n", heartbeat); |
189 | heartbeat); | ||
190 | return ret; | 189 | return ret; |
191 | } | 190 | } |
192 | 191 | ||
diff --git a/drivers/watchdog/ks8695_wdt.c b/drivers/watchdog/ks8695_wdt.c index 51757a520e8f..4ee0c7119b45 100644 --- a/drivers/watchdog/ks8695_wdt.c +++ b/drivers/watchdog/ks8695_wdt.c | |||
@@ -8,6 +8,8 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
12 | |||
11 | #include <linux/bitops.h> | 13 | #include <linux/bitops.h> |
12 | #include <linux/errno.h> | 14 | #include <linux/errno.h> |
13 | #include <linux/fs.h> | 15 | #include <linux/fs.h> |
@@ -233,8 +235,8 @@ static int __devinit ks8695wdt_probe(struct platform_device *pdev) | |||
233 | if (res) | 235 | if (res) |
234 | return res; | 236 | return res; |
235 | 237 | ||
236 | printk(KERN_INFO "KS8695 Watchdog Timer enabled (%d seconds%s)\n", | 238 | pr_info("KS8695 Watchdog Timer enabled (%d seconds%s)\n", |
237 | wdt_time, nowayout ? ", nowayout" : ""); | 239 | wdt_time, nowayout ? ", nowayout" : ""); |
238 | return 0; | 240 | return 0; |
239 | } | 241 | } |
240 | 242 | ||
diff --git a/drivers/watchdog/lantiq_wdt.c b/drivers/watchdog/lantiq_wdt.c index d3a63be2e28d..83044351042c 100644 --- a/drivers/watchdog/lantiq_wdt.c +++ b/drivers/watchdog/lantiq_wdt.c | |||
@@ -7,6 +7,8 @@ | |||
7 | * Based on EP93xx wdt driver | 7 | * Based on EP93xx wdt driver |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
11 | |||
10 | #include <linux/module.h> | 12 | #include <linux/module.h> |
11 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
12 | #include <linux/miscdevice.h> | 14 | #include <linux/miscdevice.h> |
@@ -160,7 +162,7 @@ ltq_wdt_release(struct inode *inode, struct file *file) | |||
160 | if (ltq_wdt_ok_to_close) | 162 | if (ltq_wdt_ok_to_close) |
161 | ltq_wdt_disable(); | 163 | ltq_wdt_disable(); |
162 | else | 164 | else |
163 | pr_err("ltq_wdt: watchdog closed without warning\n"); | 165 | pr_err("watchdog closed without warning\n"); |
164 | ltq_wdt_ok_to_close = 0; | 166 | ltq_wdt_ok_to_close = 0; |
165 | clear_bit(0, <q_wdt_in_use); | 167 | clear_bit(0, <q_wdt_in_use); |
166 | 168 | ||
diff --git a/drivers/watchdog/m54xx_wdt.c b/drivers/watchdog/m54xx_wdt.c index 4d43286074aa..88e6c8ba4176 100644 --- a/drivers/watchdog/m54xx_wdt.c +++ b/drivers/watchdog/m54xx_wdt.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * warranty of any kind, whether express or implied. | 16 | * warranty of any kind, whether express or implied. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
20 | |||
19 | #include <linux/module.h> | 21 | #include <linux/module.h> |
20 | #include <linux/moduleparam.h> | 22 | #include <linux/moduleparam.h> |
21 | #include <linux/types.h> | 23 | #include <linux/types.h> |
@@ -166,8 +168,7 @@ static int m54xx_wdt_release(struct inode *inode, struct file *file) | |||
166 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) | 168 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) |
167 | wdt_disable(); | 169 | wdt_disable(); |
168 | else { | 170 | else { |
169 | printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " | 171 | pr_crit("Device closed unexpectedly - timer will not stop\n"); |
170 | "timer will not stop\n"); | ||
171 | wdt_keepalive(); | 172 | wdt_keepalive(); |
172 | } | 173 | } |
173 | clear_bit(WDT_IN_USE, &wdt_status); | 174 | clear_bit(WDT_IN_USE, &wdt_status); |
@@ -196,11 +197,10 @@ static int __init m54xx_wdt_init(void) | |||
196 | { | 197 | { |
197 | if (!request_mem_region(MCF_MBAR + MCF_GPT_GCIR0, 4, | 198 | if (!request_mem_region(MCF_MBAR + MCF_GPT_GCIR0, 4, |
198 | "Coldfire M54xx Watchdog")) { | 199 | "Coldfire M54xx Watchdog")) { |
199 | printk(KERN_WARNING | 200 | pr_warn("I/O region busy\n"); |
200 | "Coldfire M54xx Watchdog : I/O region busy\n"); | ||
201 | return -EBUSY; | 201 | return -EBUSY; |
202 | } | 202 | } |
203 | printk(KERN_INFO "ColdFire watchdog driver is loaded.\n"); | 203 | pr_info("driver is loaded\n"); |
204 | 204 | ||
205 | return misc_register(&m54xx_wdt_miscdev); | 205 | return misc_register(&m54xx_wdt_miscdev); |
206 | } | 206 | } |
diff --git a/drivers/watchdog/machzwd.c b/drivers/watchdog/machzwd.c index 1332b838cc58..a2ecc9656920 100644 --- a/drivers/watchdog/machzwd.c +++ b/drivers/watchdog/machzwd.c | |||
@@ -28,6 +28,8 @@ | |||
28 | * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT | 28 | * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
32 | |||
31 | #include <linux/module.h> | 33 | #include <linux/module.h> |
32 | #include <linux/moduleparam.h> | 34 | #include <linux/moduleparam.h> |
33 | #include <linux/types.h> | 35 | #include <linux/types.h> |
@@ -141,10 +143,10 @@ static unsigned long next_heartbeat; | |||
141 | #define ZF_CTIMEOUT 0xffff | 143 | #define ZF_CTIMEOUT 0xffff |
142 | 144 | ||
143 | #ifndef ZF_DEBUG | 145 | #ifndef ZF_DEBUG |
144 | # define dprintk(format, args...) | 146 | #define dprintk(format, args...) |
145 | #else | 147 | #else |
146 | # define dprintk(format, args...) printk(KERN_DEBUG PFX \ | 148 | #define dprintk(format, args...) \ |
147 | ":%s:%d: " format, __func__, __LINE__ , ## args) | 149 | pr_debug(":%s:%d: " format, __func__, __LINE__ , ## args) |
148 | #endif | 150 | #endif |
149 | 151 | ||
150 | 152 | ||
@@ -203,7 +205,7 @@ static void zf_timer_off(void) | |||
203 | zf_set_control(ctrl_reg); | 205 | zf_set_control(ctrl_reg); |
204 | spin_unlock_irqrestore(&zf_port_lock, flags); | 206 | spin_unlock_irqrestore(&zf_port_lock, flags); |
205 | 207 | ||
206 | printk(KERN_INFO PFX ": Watchdog timer is now disabled\n"); | 208 | pr_info("Watchdog timer is now disabled\n"); |
207 | } | 209 | } |
208 | 210 | ||
209 | 211 | ||
@@ -233,7 +235,7 @@ static void zf_timer_on(void) | |||
233 | zf_set_control(ctrl_reg); | 235 | zf_set_control(ctrl_reg); |
234 | spin_unlock_irqrestore(&zf_port_lock, flags); | 236 | spin_unlock_irqrestore(&zf_port_lock, flags); |
235 | 237 | ||
236 | printk(KERN_INFO PFX ": Watchdog timer is now enabled\n"); | 238 | pr_info("Watchdog timer is now enabled\n"); |
237 | } | 239 | } |
238 | 240 | ||
239 | 241 | ||
@@ -263,7 +265,7 @@ static void zf_ping(unsigned long data) | |||
263 | 265 | ||
264 | mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO); | 266 | mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO); |
265 | } else | 267 | } else |
266 | printk(KERN_CRIT PFX ": I will reset your machine\n"); | 268 | pr_crit("I will reset your machine\n"); |
267 | } | 269 | } |
268 | 270 | ||
269 | static ssize_t zf_write(struct file *file, const char __user *buf, size_t count, | 271 | static ssize_t zf_write(struct file *file, const char __user *buf, size_t count, |
@@ -342,8 +344,7 @@ static int zf_close(struct inode *inode, struct file *file) | |||
342 | zf_timer_off(); | 344 | zf_timer_off(); |
343 | else { | 345 | else { |
344 | del_timer(&zf_timer); | 346 | del_timer(&zf_timer); |
345 | printk(KERN_ERR PFX ": device file closed unexpectedly. " | 347 | pr_err("device file closed unexpectedly. Will not stop the WDT!\n"); |
346 | "Will not stop the WDT!\n"); | ||
347 | } | 348 | } |
348 | clear_bit(0, &zf_is_open); | 349 | clear_bit(0, &zf_is_open); |
349 | zf_expect_close = 0; | 350 | zf_expect_close = 0; |
@@ -390,19 +391,18 @@ static void __init zf_show_action(int act) | |||
390 | { | 391 | { |
391 | static const char * const str[] = { "RESET", "SMI", "NMI", "SCI" }; | 392 | static const char * const str[] = { "RESET", "SMI", "NMI", "SCI" }; |
392 | 393 | ||
393 | printk(KERN_INFO PFX ": Watchdog using action = %s\n", str[act]); | 394 | pr_info("Watchdog using action = %s\n", str[act]); |
394 | } | 395 | } |
395 | 396 | ||
396 | static int __init zf_init(void) | 397 | static int __init zf_init(void) |
397 | { | 398 | { |
398 | int ret; | 399 | int ret; |
399 | 400 | ||
400 | printk(KERN_INFO PFX | 401 | pr_info("MachZ ZF-Logic Watchdog driver initializing\n"); |
401 | ": MachZ ZF-Logic Watchdog driver initializing.\n"); | ||
402 | 402 | ||
403 | ret = zf_get_ZFL_version(); | 403 | ret = zf_get_ZFL_version(); |
404 | if (!ret || ret == 0xffff) { | 404 | if (!ret || ret == 0xffff) { |
405 | printk(KERN_WARNING PFX ": no ZF-Logic found\n"); | 405 | pr_warn("no ZF-Logic found\n"); |
406 | return -ENODEV; | 406 | return -ENODEV; |
407 | } | 407 | } |
408 | 408 | ||
@@ -414,23 +414,20 @@ static int __init zf_init(void) | |||
414 | zf_show_action(action); | 414 | zf_show_action(action); |
415 | 415 | ||
416 | if (!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")) { | 416 | if (!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")) { |
417 | printk(KERN_ERR "cannot reserve I/O ports at %d\n", | 417 | pr_err("cannot reserve I/O ports at %d\n", ZF_IOBASE); |
418 | ZF_IOBASE); | ||
419 | ret = -EBUSY; | 418 | ret = -EBUSY; |
420 | goto no_region; | 419 | goto no_region; |
421 | } | 420 | } |
422 | 421 | ||
423 | ret = register_reboot_notifier(&zf_notifier); | 422 | ret = register_reboot_notifier(&zf_notifier); |
424 | if (ret) { | 423 | if (ret) { |
425 | printk(KERN_ERR "can't register reboot notifier (err=%d)\n", | 424 | pr_err("can't register reboot notifier (err=%d)\n", ret); |
426 | ret); | ||
427 | goto no_reboot; | 425 | goto no_reboot; |
428 | } | 426 | } |
429 | 427 | ||
430 | ret = misc_register(&zf_miscdev); | 428 | ret = misc_register(&zf_miscdev); |
431 | if (ret) { | 429 | if (ret) { |
432 | printk(KERN_ERR "can't misc_register on minor=%d\n", | 430 | pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR); |
433 | WATCHDOG_MINOR); | ||
434 | goto no_misc; | 431 | goto no_misc; |
435 | } | 432 | } |
436 | 433 | ||
diff --git a/drivers/watchdog/mixcomwd.c b/drivers/watchdog/mixcomwd.c index bc820d16699a..17ec5b9dddd2 100644 --- a/drivers/watchdog/mixcomwd.c +++ b/drivers/watchdog/mixcomwd.c | |||
@@ -39,9 +39,10 @@ | |||
39 | * | 39 | * |
40 | */ | 40 | */ |
41 | 41 | ||
42 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
43 | |||
42 | #define VERSION "0.6" | 44 | #define VERSION "0.6" |
43 | #define WATCHDOG_NAME "mixcomwd" | 45 | #define WATCHDOG_NAME "mixcomwd" |
44 | #define PFX WATCHDOG_NAME ": " | ||
45 | 46 | ||
46 | #include <linux/module.h> | 47 | #include <linux/module.h> |
47 | #include <linux/moduleparam.h> | 48 | #include <linux/moduleparam.h> |
@@ -156,15 +157,13 @@ static int mixcomwd_release(struct inode *inode, struct file *file) | |||
156 | { | 157 | { |
157 | if (expect_close == 42) { | 158 | if (expect_close == 42) { |
158 | if (mixcomwd_timer_alive) { | 159 | if (mixcomwd_timer_alive) { |
159 | printk(KERN_ERR PFX | 160 | pr_err("release called while internal timer alive\n"); |
160 | "release called while internal timer alive"); | ||
161 | return -EBUSY; | 161 | return -EBUSY; |
162 | } | 162 | } |
163 | mixcomwd_timer_alive = 1; | 163 | mixcomwd_timer_alive = 1; |
164 | mod_timer(&mixcomwd_timer, jiffies + 5 * HZ); | 164 | mod_timer(&mixcomwd_timer, jiffies + 5 * HZ); |
165 | } else | 165 | } else |
166 | printk(KERN_CRIT PFX | 166 | pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); |
167 | "WDT device closed unexpectedly. WDT will not stop!\n"); | ||
168 | 167 | ||
169 | clear_bit(0, &mixcomwd_opened); | 168 | clear_bit(0, &mixcomwd_opened); |
170 | expect_close = 0; | 169 | expect_close = 0; |
@@ -274,22 +273,19 @@ static int __init mixcomwd_init(void) | |||
274 | } | 273 | } |
275 | 274 | ||
276 | if (!found) { | 275 | if (!found) { |
277 | printk(KERN_ERR PFX | 276 | pr_err("No card detected, or port not available\n"); |
278 | "No card detected, or port not available.\n"); | ||
279 | return -ENODEV; | 277 | return -ENODEV; |
280 | } | 278 | } |
281 | 279 | ||
282 | ret = misc_register(&mixcomwd_miscdev); | 280 | ret = misc_register(&mixcomwd_miscdev); |
283 | if (ret) { | 281 | if (ret) { |
284 | printk(KERN_ERR PFX | 282 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
285 | "cannot register miscdev on minor=%d (err=%d)\n", | 283 | WATCHDOG_MINOR, ret); |
286 | WATCHDOG_MINOR, ret); | ||
287 | goto error_misc_register_watchdog; | 284 | goto error_misc_register_watchdog; |
288 | } | 285 | } |
289 | 286 | ||
290 | printk(KERN_INFO | 287 | pr_info("MixCOM watchdog driver v%s, watchdog port at 0x%3x\n", |
291 | "MixCOM watchdog driver v%s, watchdog port at 0x%3x\n", | 288 | VERSION, watchdog_port); |
292 | VERSION, watchdog_port); | ||
293 | 289 | ||
294 | return 0; | 290 | return 0; |
295 | 291 | ||
@@ -303,8 +299,7 @@ static void __exit mixcomwd_exit(void) | |||
303 | { | 299 | { |
304 | if (!nowayout) { | 300 | if (!nowayout) { |
305 | if (mixcomwd_timer_alive) { | 301 | if (mixcomwd_timer_alive) { |
306 | printk(KERN_WARNING PFX "I quit now, hardware will" | 302 | pr_warn("I quit now, hardware will probably reboot!\n"); |
307 | " probably reboot!\n"); | ||
308 | del_timer_sync(&mixcomwd_timer); | 303 | del_timer_sync(&mixcomwd_timer); |
309 | mixcomwd_timer_alive = 0; | 304 | mixcomwd_timer_alive = 0; |
310 | } | 305 | } |
diff --git a/drivers/watchdog/mpc8xxx_wdt.c b/drivers/watchdog/mpc8xxx_wdt.c index 20feb4d3d791..3e335fa0f17d 100644 --- a/drivers/watchdog/mpc8xxx_wdt.c +++ b/drivers/watchdog/mpc8xxx_wdt.c | |||
@@ -17,6 +17,8 @@ | |||
17 | * option) any later version. | 17 | * option) any later version. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
21 | #include <linux/init.h> | 23 | #include <linux/init.h> |
22 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
@@ -96,7 +98,7 @@ static void mpc8xxx_wdt_timer_ping(unsigned long arg) | |||
96 | 98 | ||
97 | static void mpc8xxx_wdt_pr_warn(const char *msg) | 99 | static void mpc8xxx_wdt_pr_warn(const char *msg) |
98 | { | 100 | { |
99 | pr_crit("mpc8xxx_wdt: %s, expect the %s soon!\n", msg, | 101 | pr_crit("%s, expect the %s soon!\n", msg, |
100 | reset ? "reset" : "machine check exception"); | 102 | reset ? "reset" : "machine check exception"); |
101 | } | 103 | } |
102 | 104 | ||
@@ -209,7 +211,7 @@ static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev) | |||
209 | 211 | ||
210 | enabled = in_be32(&wd_base->swcrr) & SWCRR_SWEN; | 212 | enabled = in_be32(&wd_base->swcrr) & SWCRR_SWEN; |
211 | if (!enabled && wdt_type->hw_enabled) { | 213 | if (!enabled && wdt_type->hw_enabled) { |
212 | pr_info("mpc8xxx_wdt: could not be enabled in software\n"); | 214 | pr_info("could not be enabled in software\n"); |
213 | ret = -ENOSYS; | 215 | ret = -ENOSYS; |
214 | goto err_unmap; | 216 | goto err_unmap; |
215 | } | 217 | } |
@@ -226,9 +228,8 @@ static int __devinit mpc8xxx_wdt_probe(struct platform_device *ofdev) | |||
226 | goto err_unmap; | 228 | goto err_unmap; |
227 | #endif | 229 | #endif |
228 | 230 | ||
229 | pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d " | 231 | pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d (%d seconds)\n", |
230 | "(%d seconds)\n", reset ? "reset" : "interrupt", timeout, | 232 | reset ? "reset" : "interrupt", timeout, timeout_sec); |
231 | timeout_sec); | ||
232 | 233 | ||
233 | /* | 234 | /* |
234 | * If the watchdog was previously enabled or we're running on | 235 | * If the watchdog was previously enabled or we're running on |
@@ -303,7 +304,7 @@ static int mpc8xxx_wdt_init_late(void) | |||
303 | ret = misc_register(&mpc8xxx_wdt_miscdev); | 304 | ret = misc_register(&mpc8xxx_wdt_miscdev); |
304 | if (ret) { | 305 | if (ret) { |
305 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", | 306 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
306 | WATCHDOG_MINOR, ret); | 307 | WATCHDOG_MINOR, ret); |
307 | return ret; | 308 | return ret; |
308 | } | 309 | } |
309 | return 0; | 310 | return 0; |
diff --git a/drivers/watchdog/mpcore_wdt.c b/drivers/watchdog/mpcore_wdt.c index 82ccd36e2c90..a7de5f6bf688 100644 --- a/drivers/watchdog/mpcore_wdt.c +++ b/drivers/watchdog/mpcore_wdt.c | |||
@@ -19,6 +19,9 @@ | |||
19 | * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> | 19 | * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> |
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | |||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
22 | #include <linux/module.h> | 25 | #include <linux/module.h> |
23 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
24 | #include <linux/types.h> | 27 | #include <linux/types.h> |
@@ -442,9 +445,6 @@ static struct platform_driver mpcore_wdt_driver = { | |||
442 | }, | 445 | }, |
443 | }; | 446 | }; |
444 | 447 | ||
445 | static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. " | ||
446 | "mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n"; | ||
447 | |||
448 | static int __init mpcore_wdt_init(void) | 448 | static int __init mpcore_wdt_init(void) |
449 | { | 449 | { |
450 | /* | 450 | /* |
@@ -453,11 +453,12 @@ static int __init mpcore_wdt_init(void) | |||
453 | */ | 453 | */ |
454 | if (mpcore_wdt_set_heartbeat(mpcore_margin)) { | 454 | if (mpcore_wdt_set_heartbeat(mpcore_margin)) { |
455 | mpcore_wdt_set_heartbeat(TIMER_MARGIN); | 455 | mpcore_wdt_set_heartbeat(TIMER_MARGIN); |
456 | printk(KERN_INFO "mpcore_margin value must be 0 < mpcore_margin < 65536, using %d\n", | 456 | pr_info("mpcore_margin value must be 0 < mpcore_margin < 65536, using %d\n", |
457 | TIMER_MARGIN); | 457 | TIMER_MARGIN); |
458 | } | 458 | } |
459 | 459 | ||
460 | printk(banner, mpcore_noboot, mpcore_margin, nowayout); | 460 | pr_info("MPcore Watchdog Timer: 0.1. mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n", |
461 | mpcore_noboot, mpcore_margin, nowayout); | ||
461 | 462 | ||
462 | return platform_driver_register(&mpcore_wdt_driver); | 463 | return platform_driver_register(&mpcore_wdt_driver); |
463 | } | 464 | } |
diff --git a/drivers/watchdog/mv64x60_wdt.c b/drivers/watchdog/mv64x60_wdt.c index 97f8a48d8b78..ee0f828bb34f 100644 --- a/drivers/watchdog/mv64x60_wdt.c +++ b/drivers/watchdog/mv64x60_wdt.c | |||
@@ -15,6 +15,8 @@ | |||
15 | * or implied. | 15 | * or implied. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
19 | |||
18 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
19 | #include <linux/init.h> | 21 | #include <linux/init.h> |
20 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
@@ -100,7 +102,7 @@ static void mv64x60_wdt_handler_enable(void) | |||
100 | if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_FALSE, | 102 | if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_FALSE, |
101 | MV64x60_WDC_ENABLE_SHIFT)) { | 103 | MV64x60_WDC_ENABLE_SHIFT)) { |
102 | mv64x60_wdt_service(); | 104 | mv64x60_wdt_service(); |
103 | printk(KERN_NOTICE "mv64x60_wdt: watchdog activated\n"); | 105 | pr_notice("watchdog activated\n"); |
104 | } | 106 | } |
105 | } | 107 | } |
106 | 108 | ||
@@ -108,7 +110,7 @@ static void mv64x60_wdt_handler_disable(void) | |||
108 | { | 110 | { |
109 | if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE, | 111 | if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE, |
110 | MV64x60_WDC_ENABLE_SHIFT)) | 112 | MV64x60_WDC_ENABLE_SHIFT)) |
111 | printk(KERN_NOTICE "mv64x60_wdt: watchdog deactivated\n"); | 113 | pr_notice("watchdog deactivated\n"); |
112 | } | 114 | } |
113 | 115 | ||
114 | static void mv64x60_wdt_set_timeout(unsigned int timeout) | 116 | static void mv64x60_wdt_set_timeout(unsigned int timeout) |
@@ -139,8 +141,7 @@ static int mv64x60_wdt_release(struct inode *inode, struct file *file) | |||
139 | if (expect_close == 42) | 141 | if (expect_close == 42) |
140 | mv64x60_wdt_handler_disable(); | 142 | mv64x60_wdt_handler_disable(); |
141 | else { | 143 | else { |
142 | printk(KERN_CRIT | 144 | pr_crit("unexpected close, not stopping timer!\n"); |
143 | "mv64x60_wdt: unexpected close, not stopping timer!\n"); | ||
144 | mv64x60_wdt_service(); | 145 | mv64x60_wdt_service(); |
145 | } | 146 | } |
146 | expect_close = 0; | 147 | expect_close = 0; |
@@ -308,7 +309,7 @@ static struct platform_driver mv64x60_wdt_driver = { | |||
308 | 309 | ||
309 | static int __init mv64x60_wdt_init(void) | 310 | static int __init mv64x60_wdt_init(void) |
310 | { | 311 | { |
311 | printk(KERN_INFO "MV64x60 watchdog driver\n"); | 312 | pr_info("MV64x60 watchdog driver\n"); |
312 | 313 | ||
313 | return platform_driver_register(&mv64x60_wdt_driver); | 314 | return platform_driver_register(&mv64x60_wdt_driver); |
314 | } | 315 | } |
diff --git a/drivers/watchdog/nv_tco.c b/drivers/watchdog/nv_tco.c index 809f41c30c44..16d9413a81c1 100644 --- a/drivers/watchdog/nv_tco.c +++ b/drivers/watchdog/nv_tco.c | |||
@@ -21,6 +21,8 @@ | |||
21 | * Includes, defines, variables, module parameters, ... | 21 | * Includes, defines, variables, module parameters, ... |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
25 | |||
24 | #include <linux/module.h> | 26 | #include <linux/module.h> |
25 | #include <linux/moduleparam.h> | 27 | #include <linux/moduleparam.h> |
26 | #include <linux/types.h> | 28 | #include <linux/types.h> |
@@ -41,7 +43,6 @@ | |||
41 | #define TCO_VERSION "0.01" | 43 | #define TCO_VERSION "0.01" |
42 | #define TCO_MODULE_NAME "NV_TCO" | 44 | #define TCO_MODULE_NAME "NV_TCO" |
43 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION | 45 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION |
44 | #define PFX TCO_MODULE_NAME ": " | ||
45 | 46 | ||
46 | /* internal variables */ | 47 | /* internal variables */ |
47 | static unsigned int tcobase; | 48 | static unsigned int tcobase; |
@@ -169,8 +170,7 @@ static int nv_tco_release(struct inode *inode, struct file *file) | |||
169 | if (tco_expect_close == 42) { | 170 | if (tco_expect_close == 42) { |
170 | tco_timer_stop(); | 171 | tco_timer_stop(); |
171 | } else { | 172 | } else { |
172 | printk(KERN_CRIT PFX "Unexpected close, not stopping " | 173 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
173 | "watchdog!\n"); | ||
174 | tco_timer_keepalive(); | 174 | tco_timer_keepalive(); |
175 | } | 175 | } |
176 | clear_bit(0, &timer_alive); | 176 | clear_bit(0, &timer_alive); |
@@ -323,15 +323,14 @@ static unsigned char __devinit nv_tco_getdevice(void) | |||
323 | val &= 0xffff; | 323 | val &= 0xffff; |
324 | if (val == 0x0001 || val == 0x0000) { | 324 | if (val == 0x0001 || val == 0x0000) { |
325 | /* Something is wrong here, bar isn't setup */ | 325 | /* Something is wrong here, bar isn't setup */ |
326 | printk(KERN_ERR PFX "failed to get tcobase address\n"); | 326 | pr_err("failed to get tcobase address\n"); |
327 | return 0; | 327 | return 0; |
328 | } | 328 | } |
329 | val &= 0xff00; | 329 | val &= 0xff00; |
330 | tcobase = val + 0x40; | 330 | tcobase = val + 0x40; |
331 | 331 | ||
332 | if (!request_region(tcobase, 0x10, "NV TCO")) { | 332 | if (!request_region(tcobase, 0x10, "NV TCO")) { |
333 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 333 | pr_err("I/O address 0x%04x already in use\n", tcobase); |
334 | tcobase); | ||
335 | return 0; | 334 | return 0; |
336 | } | 335 | } |
337 | 336 | ||
@@ -347,7 +346,7 @@ static unsigned char __devinit nv_tco_getdevice(void) | |||
347 | 346 | ||
348 | /* Disable SMI caused by TCO */ | 347 | /* Disable SMI caused by TCO */ |
349 | if (!request_region(MCP51_SMI_EN(tcobase), 4, "NV TCO")) { | 348 | if (!request_region(MCP51_SMI_EN(tcobase), 4, "NV TCO")) { |
350 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 349 | pr_err("I/O address 0x%04x already in use\n", |
351 | MCP51_SMI_EN(tcobase)); | 350 | MCP51_SMI_EN(tcobase)); |
352 | goto out; | 351 | goto out; |
353 | } | 352 | } |
@@ -357,7 +356,7 @@ static unsigned char __devinit nv_tco_getdevice(void) | |||
357 | val = inl(MCP51_SMI_EN(tcobase)); | 356 | val = inl(MCP51_SMI_EN(tcobase)); |
358 | release_region(MCP51_SMI_EN(tcobase), 4); | 357 | release_region(MCP51_SMI_EN(tcobase), 4); |
359 | if (val & MCP51_SMI_EN_TCO) { | 358 | if (val & MCP51_SMI_EN_TCO) { |
360 | printk(KERN_ERR PFX "Could not disable SMI caused by TCO\n"); | 359 | pr_err("Could not disable SMI caused by TCO\n"); |
361 | goto out; | 360 | goto out; |
362 | } | 361 | } |
363 | 362 | ||
@@ -367,8 +366,7 @@ static unsigned char __devinit nv_tco_getdevice(void) | |||
367 | pci_write_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, val); | 366 | pci_write_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, val); |
368 | pci_read_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, &val); | 367 | pci_read_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, &val); |
369 | if (!(val & MCP51_SMBUS_SETUP_B_TCO_REBOOT)) { | 368 | if (!(val & MCP51_SMBUS_SETUP_B_TCO_REBOOT)) { |
370 | printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot " | 369 | pr_err("failed to reset NO_REBOOT flag, reboot disabled by hardware\n"); |
371 | "disabled by hardware\n"); | ||
372 | goto out; | 370 | goto out; |
373 | } | 371 | } |
374 | 372 | ||
@@ -387,8 +385,8 @@ static int __devinit nv_tco_init(struct platform_device *dev) | |||
387 | return -ENODEV; | 385 | return -ENODEV; |
388 | 386 | ||
389 | /* Check to see if last reboot was due to watchdog timeout */ | 387 | /* Check to see if last reboot was due to watchdog timeout */ |
390 | printk(KERN_INFO PFX "Watchdog reboot %sdetected.\n", | 388 | pr_info("Watchdog reboot %sdetected\n", |
391 | inl(TCO_STS(tcobase)) & TCO_STS_TCO2TO_STS ? "" : "not "); | 389 | inl(TCO_STS(tcobase)) & TCO_STS_TCO2TO_STS ? "" : "not "); |
392 | 390 | ||
393 | /* Clear out the old status */ | 391 | /* Clear out the old status */ |
394 | outl(TCO_STS_RESET, TCO_STS(tcobase)); | 392 | outl(TCO_STS_RESET, TCO_STS(tcobase)); |
@@ -400,14 +398,14 @@ static int __devinit nv_tco_init(struct platform_device *dev) | |||
400 | if (tco_timer_set_heartbeat(heartbeat)) { | 398 | if (tco_timer_set_heartbeat(heartbeat)) { |
401 | heartbeat = WATCHDOG_HEARTBEAT; | 399 | heartbeat = WATCHDOG_HEARTBEAT; |
402 | tco_timer_set_heartbeat(heartbeat); | 400 | tco_timer_set_heartbeat(heartbeat); |
403 | printk(KERN_INFO PFX "heartbeat value must be 2<heartbeat<39, " | 401 | pr_info("heartbeat value must be 2<heartbeat<39, using %d\n", |
404 | "using %d\n", heartbeat); | 402 | heartbeat); |
405 | } | 403 | } |
406 | 404 | ||
407 | ret = misc_register(&nv_tco_miscdev); | 405 | ret = misc_register(&nv_tco_miscdev); |
408 | if (ret != 0) { | 406 | if (ret != 0) { |
409 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d " | 407 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
410 | "(err=%d)\n", WATCHDOG_MINOR, ret); | 408 | WATCHDOG_MINOR, ret); |
411 | goto unreg_region; | 409 | goto unreg_region; |
412 | } | 410 | } |
413 | 411 | ||
@@ -415,8 +413,8 @@ static int __devinit nv_tco_init(struct platform_device *dev) | |||
415 | 413 | ||
416 | tco_timer_stop(); | 414 | tco_timer_stop(); |
417 | 415 | ||
418 | printk(KERN_INFO PFX "initialized (0x%04x). heartbeat=%d sec " | 416 | pr_info("initialized (0x%04x). heartbeat=%d sec (nowayout=%d)\n", |
419 | "(nowayout=%d)\n", tcobase, heartbeat, nowayout); | 417 | tcobase, heartbeat, nowayout); |
420 | 418 | ||
421 | return 0; | 419 | return 0; |
422 | 420 | ||
@@ -439,8 +437,7 @@ static void __devexit nv_tco_cleanup(void) | |||
439 | pci_write_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, val); | 437 | pci_write_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, val); |
440 | pci_read_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, &val); | 438 | pci_read_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, &val); |
441 | if (val & MCP51_SMBUS_SETUP_B_TCO_REBOOT) { | 439 | if (val & MCP51_SMBUS_SETUP_B_TCO_REBOOT) { |
442 | printk(KERN_CRIT PFX "Couldn't unset REBOOT bit. Machine may " | 440 | pr_crit("Couldn't unset REBOOT bit. Machine may soon reset\n"); |
443 | "soon reset\n"); | ||
444 | } | 441 | } |
445 | 442 | ||
446 | /* Deregister */ | 443 | /* Deregister */ |
@@ -483,8 +480,7 @@ static int __init nv_tco_init_module(void) | |||
483 | { | 480 | { |
484 | int err; | 481 | int err; |
485 | 482 | ||
486 | printk(KERN_INFO PFX "NV TCO WatchDog Timer Driver v%s\n", | 483 | pr_info("NV TCO WatchDog Timer Driver v%s\n", TCO_VERSION); |
487 | TCO_VERSION); | ||
488 | 484 | ||
489 | err = platform_driver_register(&nv_tco_driver); | 485 | err = platform_driver_register(&nv_tco_driver); |
490 | if (err) | 486 | if (err) |
@@ -508,7 +504,7 @@ static void __exit nv_tco_cleanup_module(void) | |||
508 | { | 504 | { |
509 | platform_device_unregister(nv_tco_platform_device); | 505 | platform_device_unregister(nv_tco_platform_device); |
510 | platform_driver_unregister(&nv_tco_driver); | 506 | platform_driver_unregister(&nv_tco_driver); |
511 | printk(KERN_INFO PFX "NV TCO Watchdog Module Unloaded.\n"); | 507 | pr_info("NV TCO Watchdog Module Unloaded\n"); |
512 | } | 508 | } |
513 | 509 | ||
514 | module_init(nv_tco_init_module); | 510 | module_init(nv_tco_init_module); |
diff --git a/drivers/watchdog/octeon-wdt-main.c b/drivers/watchdog/octeon-wdt-main.c index 7c0d8630e641..c5a3ff957b8e 100644 --- a/drivers/watchdog/octeon-wdt-main.c +++ b/drivers/watchdog/octeon-wdt-main.c | |||
@@ -52,6 +52,8 @@ | |||
52 | * | 52 | * |
53 | */ | 53 | */ |
54 | 54 | ||
55 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
56 | |||
55 | #include <linux/miscdevice.h> | 57 | #include <linux/miscdevice.h> |
56 | #include <linux/interrupt.h> | 58 | #include <linux/interrupt.h> |
57 | #include <linux/watchdog.h> | 59 | #include <linux/watchdog.h> |
@@ -201,7 +203,7 @@ static void __init octeon_wdt_build_stage1(void) | |||
201 | uasm_resolve_relocs(relocs, labels); | 203 | uasm_resolve_relocs(relocs, labels); |
202 | 204 | ||
203 | len = (int)(p - nmi_stage1_insns); | 205 | len = (int)(p - nmi_stage1_insns); |
204 | pr_debug("Synthesized NMI stage 1 handler (%d instructions).\n", len); | 206 | pr_debug("Synthesized NMI stage 1 handler (%d instructions)\n", len); |
205 | 207 | ||
206 | pr_debug("\t.set push\n"); | 208 | pr_debug("\t.set push\n"); |
207 | pr_debug("\t.set noreorder\n"); | 209 | pr_debug("\t.set noreorder\n"); |
@@ -627,7 +629,7 @@ static int octeon_wdt_release(struct inode *inode, struct file *file) | |||
627 | do_coundown = 0; | 629 | do_coundown = 0; |
628 | octeon_wdt_ping(); | 630 | octeon_wdt_ping(); |
629 | } else { | 631 | } else { |
630 | pr_crit("octeon_wdt: WDT device closed unexpectedly. WDT will not stop!\n"); | 632 | pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); |
631 | } | 633 | } |
632 | clear_bit(0, &octeon_wdt_is_open); | 634 | clear_bit(0, &octeon_wdt_is_open); |
633 | expect_close = 0; | 635 | expect_close = 0; |
@@ -684,12 +686,12 @@ static int __init octeon_wdt_init(void) | |||
684 | 686 | ||
685 | octeon_wdt_calc_parameters(heartbeat); | 687 | octeon_wdt_calc_parameters(heartbeat); |
686 | 688 | ||
687 | pr_info("octeon_wdt: Initial granularity %d Sec.\n", timeout_sec); | 689 | pr_info("Initial granularity %d Sec\n", timeout_sec); |
688 | 690 | ||
689 | ret = misc_register(&octeon_wdt_miscdev); | 691 | ret = misc_register(&octeon_wdt_miscdev); |
690 | if (ret) { | 692 | if (ret) { |
691 | pr_err("octeon_wdt: cannot register miscdev on minor=%d (err=%d)\n", | 693 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
692 | WATCHDOG_MINOR, ret); | 694 | WATCHDOG_MINOR, ret); |
693 | goto out; | 695 | goto out; |
694 | } | 696 | } |
695 | 697 | ||
diff --git a/drivers/watchdog/of_xilinx_wdt.c b/drivers/watchdog/of_xilinx_wdt.c index f359ab85c3bc..55d2f66dbeae 100644 --- a/drivers/watchdog/of_xilinx_wdt.c +++ b/drivers/watchdog/of_xilinx_wdt.c | |||
@@ -19,6 +19,8 @@ | |||
19 | * know the wdt reset interval | 19 | * know the wdt reset interval |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
23 | |||
22 | #include <linux/module.h> | 24 | #include <linux/module.h> |
23 | #include <linux/types.h> | 25 | #include <linux/types.h> |
24 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
@@ -99,7 +101,7 @@ static void xwdt_stop(void) | |||
99 | iowrite32(0, xdev.base + XWT_TWCSR1_OFFSET); | 101 | iowrite32(0, xdev.base + XWT_TWCSR1_OFFSET); |
100 | 102 | ||
101 | spin_unlock(&spinlock); | 103 | spin_unlock(&spinlock); |
102 | printk(KERN_INFO PFX "Stopped!\n"); | 104 | pr_info("Stopped!\n"); |
103 | } | 105 | } |
104 | 106 | ||
105 | static void xwdt_keepalive(void) | 107 | static void xwdt_keepalive(void) |
@@ -165,7 +167,7 @@ static int xwdt_open(struct inode *inode, struct file *file) | |||
165 | __module_get(THIS_MODULE); | 167 | __module_get(THIS_MODULE); |
166 | 168 | ||
167 | xwdt_start(); | 169 | xwdt_start(); |
168 | printk(KERN_INFO PFX "Started...\n"); | 170 | pr_info("Started...\n"); |
169 | 171 | ||
170 | return nonseekable_open(inode, file); | 172 | return nonseekable_open(inode, file); |
171 | } | 173 | } |
@@ -175,8 +177,7 @@ static int xwdt_release(struct inode *inode, struct file *file) | |||
175 | if (expect_close == 42) { | 177 | if (expect_close == 42) { |
176 | xwdt_stop(); | 178 | xwdt_stop(); |
177 | } else { | 179 | } else { |
178 | printk(KERN_CRIT PFX | 180 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
179 | "Unexpected close, not stopping watchdog!\n"); | ||
180 | xwdt_keepalive(); | 181 | xwdt_keepalive(); |
181 | } | 182 | } |
182 | 183 | ||
@@ -300,22 +301,20 @@ static int __devinit xwdt_probe(struct platform_device *pdev) | |||
300 | "clock-frequency", NULL); | 301 | "clock-frequency", NULL); |
301 | 302 | ||
302 | if (pfreq == NULL) { | 303 | if (pfreq == NULL) { |
303 | printk(KERN_WARNING PFX | 304 | pr_warn("The watchdog clock frequency cannot be obtained!\n"); |
304 | "The watchdog clock frequency cannot be obtained!\n"); | ||
305 | no_timeout = 1; | 305 | no_timeout = 1; |
306 | } | 306 | } |
307 | 307 | ||
308 | rc = of_address_to_resource(pdev->dev.of_node, 0, &xdev.res); | 308 | rc = of_address_to_resource(pdev->dev.of_node, 0, &xdev.res); |
309 | if (rc) { | 309 | if (rc) { |
310 | printk(KERN_WARNING PFX "invalid address!\n"); | 310 | pr_warn("invalid address!\n"); |
311 | return rc; | 311 | return rc; |
312 | } | 312 | } |
313 | 313 | ||
314 | tmptr = (u32 *)of_get_property(pdev->dev.of_node, | 314 | tmptr = (u32 *)of_get_property(pdev->dev.of_node, |
315 | "xlnx,wdt-interval", NULL); | 315 | "xlnx,wdt-interval", NULL); |
316 | if (tmptr == NULL) { | 316 | if (tmptr == NULL) { |
317 | printk(KERN_WARNING PFX "Parameter \"xlnx,wdt-interval\"" | 317 | pr_warn("Parameter \"xlnx,wdt-interval\" not found in device tree!\n"); |
318 | " not found in device tree!\n"); | ||
319 | no_timeout = 1; | 318 | no_timeout = 1; |
320 | } else { | 319 | } else { |
321 | xdev.wdt_interval = *tmptr; | 320 | xdev.wdt_interval = *tmptr; |
@@ -324,8 +323,7 @@ static int __devinit xwdt_probe(struct platform_device *pdev) | |||
324 | tmptr = (u32 *)of_get_property(pdev->dev.of_node, | 323 | tmptr = (u32 *)of_get_property(pdev->dev.of_node, |
325 | "xlnx,wdt-enable-once", NULL); | 324 | "xlnx,wdt-enable-once", NULL); |
326 | if (tmptr == NULL) { | 325 | if (tmptr == NULL) { |
327 | printk(KERN_WARNING PFX "Parameter \"xlnx,wdt-enable-once\"" | 326 | pr_warn("Parameter \"xlnx,wdt-enable-once\" not found in device tree!\n"); |
328 | " not found in device tree!\n"); | ||
329 | xdev.nowayout = WATCHDOG_NOWAYOUT; | 327 | xdev.nowayout = WATCHDOG_NOWAYOUT; |
330 | } | 328 | } |
331 | 329 | ||
@@ -339,20 +337,20 @@ static int __devinit xwdt_probe(struct platform_device *pdev) | |||
339 | if (!request_mem_region(xdev.res.start, | 337 | if (!request_mem_region(xdev.res.start, |
340 | xdev.res.end - xdev.res.start + 1, WATCHDOG_NAME)) { | 338 | xdev.res.end - xdev.res.start + 1, WATCHDOG_NAME)) { |
341 | rc = -ENXIO; | 339 | rc = -ENXIO; |
342 | printk(KERN_ERR PFX "memory request failure!\n"); | 340 | pr_err("memory request failure!\n"); |
343 | goto err_out; | 341 | goto err_out; |
344 | } | 342 | } |
345 | 343 | ||
346 | xdev.base = ioremap(xdev.res.start, xdev.res.end - xdev.res.start + 1); | 344 | xdev.base = ioremap(xdev.res.start, xdev.res.end - xdev.res.start + 1); |
347 | if (xdev.base == NULL) { | 345 | if (xdev.base == NULL) { |
348 | rc = -ENOMEM; | 346 | rc = -ENOMEM; |
349 | printk(KERN_ERR PFX "ioremap failure!\n"); | 347 | pr_err("ioremap failure!\n"); |
350 | goto release_mem; | 348 | goto release_mem; |
351 | } | 349 | } |
352 | 350 | ||
353 | rc = xwdt_selftest(); | 351 | rc = xwdt_selftest(); |
354 | if (rc == XWT_TIMER_FAILED) { | 352 | if (rc == XWT_TIMER_FAILED) { |
355 | printk(KERN_ERR PFX "SelfTest routine error!\n"); | 353 | pr_err("SelfTest routine error!\n"); |
356 | goto unmap_io; | 354 | goto unmap_io; |
357 | } | 355 | } |
358 | 356 | ||
@@ -360,20 +358,17 @@ static int __devinit xwdt_probe(struct platform_device *pdev) | |||
360 | 358 | ||
361 | rc = misc_register(&xwdt_miscdev); | 359 | rc = misc_register(&xwdt_miscdev); |
362 | if (rc) { | 360 | if (rc) { |
363 | printk(KERN_ERR PFX | 361 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
364 | "cannot register miscdev on minor=%d (err=%d)\n", | 362 | xwdt_miscdev.minor, rc); |
365 | xwdt_miscdev.minor, rc); | ||
366 | goto unmap_io; | 363 | goto unmap_io; |
367 | } | 364 | } |
368 | 365 | ||
369 | if (no_timeout) | 366 | if (no_timeout) |
370 | printk(KERN_INFO PFX | 367 | pr_info("driver loaded (timeout=? sec, nowayout=%d)\n", |
371 | "driver loaded (timeout=? sec, nowayout=%d)\n", | 368 | xdev.nowayout); |
372 | xdev.nowayout); | ||
373 | else | 369 | else |
374 | printk(KERN_INFO PFX | 370 | pr_info("driver loaded (timeout=%d sec, nowayout=%d)\n", |
375 | "driver loaded (timeout=%d sec, nowayout=%d)\n", | 371 | timeout, xdev.nowayout); |
376 | timeout, xdev.nowayout); | ||
377 | 372 | ||
378 | expect_close = 0; | 373 | expect_close = 0; |
379 | clear_bit(0, &driver_open); | 374 | clear_bit(0, &driver_open); |
diff --git a/drivers/watchdog/omap_wdt.c b/drivers/watchdog/omap_wdt.c index d19ff5145e82..8285d65cd207 100644 --- a/drivers/watchdog/omap_wdt.c +++ b/drivers/watchdog/omap_wdt.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * Use the driver model and standard identifiers; handle bigger timeouts. | 26 | * Use the driver model and standard identifiers; handle bigger timeouts. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/module.h> | 31 | #include <linux/module.h> |
30 | #include <linux/types.h> | 32 | #include <linux/types.h> |
31 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
@@ -183,7 +185,7 @@ static int omap_wdt_release(struct inode *inode, struct file *file) | |||
183 | 185 | ||
184 | pm_runtime_put_sync(wdev->dev); | 186 | pm_runtime_put_sync(wdev->dev); |
185 | #else | 187 | #else |
186 | printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n"); | 188 | pr_crit("Unexpected close, not stopping!\n"); |
187 | #endif | 189 | #endif |
188 | wdev->omap_wdt_users = 0; | 190 | wdev->omap_wdt_users = 0; |
189 | 191 | ||
diff --git a/drivers/watchdog/orion_wdt.c b/drivers/watchdog/orion_wdt.c index 4ad78f868515..25c954d2ffaa 100644 --- a/drivers/watchdog/orion_wdt.c +++ b/drivers/watchdog/orion_wdt.c | |||
@@ -10,6 +10,8 @@ | |||
10 | * warranty of any kind, whether express or implied. | 10 | * warranty of any kind, whether express or implied. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
14 | |||
13 | #include <linux/module.h> | 15 | #include <linux/module.h> |
14 | #include <linux/moduleparam.h> | 16 | #include <linux/moduleparam.h> |
15 | #include <linux/types.h> | 17 | #include <linux/types.h> |
@@ -209,8 +211,7 @@ static int orion_wdt_release(struct inode *inode, struct file *file) | |||
209 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) | 211 | if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) |
210 | orion_wdt_disable(); | 212 | orion_wdt_disable(); |
211 | else | 213 | else |
212 | printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " | 214 | pr_crit("Device closed unexpectedly - timer will not stop\n"); |
213 | "timer will not stop\n"); | ||
214 | clear_bit(WDT_IN_USE, &wdt_status); | 215 | clear_bit(WDT_IN_USE, &wdt_status); |
215 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); | 216 | clear_bit(WDT_OK_TO_CLOSE, &wdt_status); |
216 | 217 | ||
@@ -241,7 +242,7 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev) | |||
241 | if (pdata) { | 242 | if (pdata) { |
242 | wdt_tclk = pdata->tclk; | 243 | wdt_tclk = pdata->tclk; |
243 | } else { | 244 | } else { |
244 | printk(KERN_ERR "Orion Watchdog misses platform data\n"); | 245 | pr_err("misses platform data\n"); |
245 | return -ENODEV; | 246 | return -ENODEV; |
246 | } | 247 | } |
247 | 248 | ||
@@ -257,8 +258,8 @@ static int __devinit orion_wdt_probe(struct platform_device *pdev) | |||
257 | if (ret) | 258 | if (ret) |
258 | return ret; | 259 | return ret; |
259 | 260 | ||
260 | printk(KERN_INFO "Orion Watchdog Timer: Initial timeout %d sec%s\n", | 261 | pr_info("Initial timeout %d sec%s\n", |
261 | heartbeat, nowayout ? ", nowayout" : ""); | 262 | heartbeat, nowayout ? ", nowayout" : ""); |
262 | return 0; | 263 | return 0; |
263 | } | 264 | } |
264 | 265 | ||
diff --git a/drivers/watchdog/pc87413_wdt.c b/drivers/watchdog/pc87413_wdt.c index e78d89986768..a86f405b6325 100644 --- a/drivers/watchdog/pc87413_wdt.c +++ b/drivers/watchdog/pc87413_wdt.c | |||
@@ -18,6 +18,8 @@ | |||
18 | * Release 1.1 | 18 | * Release 1.1 |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
22 | |||
21 | #include <linux/module.h> | 23 | #include <linux/module.h> |
22 | #include <linux/types.h> | 24 | #include <linux/types.h> |
23 | #include <linux/miscdevice.h> | 25 | #include <linux/miscdevice.h> |
@@ -42,7 +44,6 @@ | |||
42 | 44 | ||
43 | #define VERSION "1.1" | 45 | #define VERSION "1.1" |
44 | #define MODNAME "pc87413 WDT" | 46 | #define MODNAME "pc87413 WDT" |
45 | #define PFX MODNAME ": " | ||
46 | #define DPFX MODNAME " - DEBUG: " | 47 | #define DPFX MODNAME " - DEBUG: " |
47 | 48 | ||
48 | #define WDT_INDEX_IO_PORT (io+0) /* I/O port base (index register) */ | 49 | #define WDT_INDEX_IO_PORT (io+0) /* I/O port base (index register) */ |
@@ -87,7 +88,7 @@ static inline void pc87413_select_wdt_out(void) | |||
87 | outb_p(cr_data, WDT_DATA_IO_PORT); | 88 | outb_p(cr_data, WDT_DATA_IO_PORT); |
88 | 89 | ||
89 | #ifdef DEBUG | 90 | #ifdef DEBUG |
90 | printk(KERN_INFO DPFX | 91 | pr_info(DPFX |
91 | "Select multiple pin,pin55,as WDT output: Bit7 to 1: %d\n", | 92 | "Select multiple pin,pin55,as WDT output: Bit7 to 1: %d\n", |
92 | cr_data); | 93 | cr_data); |
93 | #endif | 94 | #endif |
@@ -111,7 +112,7 @@ static inline void pc87413_enable_swc(void) | |||
111 | outb_p(cr_data, WDT_DATA_IO_PORT); /* Index0x30_bit0P1 */ | 112 | outb_p(cr_data, WDT_DATA_IO_PORT); /* Index0x30_bit0P1 */ |
112 | 113 | ||
113 | #ifdef DEBUG | 114 | #ifdef DEBUG |
114 | printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n"); | 115 | pr_info(DPFX "pc87413 - Enable SWC functions\n"); |
115 | #endif | 116 | #endif |
116 | } | 117 | } |
117 | 118 | ||
@@ -132,7 +133,7 @@ static void pc87413_get_swc_base_addr(void) | |||
132 | 133 | ||
133 | swc_base_addr = (addr_h << 8) + addr_l; | 134 | swc_base_addr = (addr_h << 8) + addr_l; |
134 | #ifdef DEBUG | 135 | #ifdef DEBUG |
135 | printk(KERN_INFO DPFX | 136 | pr_info(DPFX |
136 | "Read SWC I/O Base Address: low %d, high %d, res %d\n", | 137 | "Read SWC I/O Base Address: low %d, high %d, res %d\n", |
137 | addr_l, addr_h, swc_base_addr); | 138 | addr_l, addr_h, swc_base_addr); |
138 | #endif | 139 | #endif |
@@ -145,7 +146,7 @@ static inline void pc87413_swc_bank3(void) | |||
145 | /* Step 4: Select Bank3 of SWC */ | 146 | /* Step 4: Select Bank3 of SWC */ |
146 | outb_p(inb(swc_base_addr + 0x0f) | 0x03, swc_base_addr + 0x0f); | 147 | outb_p(inb(swc_base_addr + 0x0f) | 0x03, swc_base_addr + 0x0f); |
147 | #ifdef DEBUG | 148 | #ifdef DEBUG |
148 | printk(KERN_INFO DPFX "Select Bank3 of SWC\n"); | 149 | pr_info(DPFX "Select Bank3 of SWC\n"); |
149 | #endif | 150 | #endif |
150 | } | 151 | } |
151 | 152 | ||
@@ -156,7 +157,7 @@ static inline void pc87413_programm_wdto(char pc87413_time) | |||
156 | /* Step 5: Programm WDTO, Twd. */ | 157 | /* Step 5: Programm WDTO, Twd. */ |
157 | outb_p(pc87413_time, swc_base_addr + WDTO); | 158 | outb_p(pc87413_time, swc_base_addr + WDTO); |
158 | #ifdef DEBUG | 159 | #ifdef DEBUG |
159 | printk(KERN_INFO DPFX "Set WDTO to %d minutes\n", pc87413_time); | 160 | pr_info(DPFX "Set WDTO to %d minutes\n", pc87413_time); |
160 | #endif | 161 | #endif |
161 | } | 162 | } |
162 | 163 | ||
@@ -167,7 +168,7 @@ static inline void pc87413_enable_wden(void) | |||
167 | /* Step 6: Enable WDEN */ | 168 | /* Step 6: Enable WDEN */ |
168 | outb_p(inb(swc_base_addr + WDCTL) | 0x01, swc_base_addr + WDCTL); | 169 | outb_p(inb(swc_base_addr + WDCTL) | 0x01, swc_base_addr + WDCTL); |
169 | #ifdef DEBUG | 170 | #ifdef DEBUG |
170 | printk(KERN_INFO DPFX "Enable WDEN\n"); | 171 | pr_info(DPFX "Enable WDEN\n"); |
171 | #endif | 172 | #endif |
172 | } | 173 | } |
173 | 174 | ||
@@ -177,7 +178,7 @@ static inline void pc87413_enable_sw_wd_tren(void) | |||
177 | /* Enable SW_WD_TREN */ | 178 | /* Enable SW_WD_TREN */ |
178 | outb_p(inb(swc_base_addr + WDCFG) | 0x80, swc_base_addr + WDCFG); | 179 | outb_p(inb(swc_base_addr + WDCFG) | 0x80, swc_base_addr + WDCFG); |
179 | #ifdef DEBUG | 180 | #ifdef DEBUG |
180 | printk(KERN_INFO DPFX "Enable SW_WD_TREN\n"); | 181 | pr_info(DPFX "Enable SW_WD_TREN\n"); |
181 | #endif | 182 | #endif |
182 | } | 183 | } |
183 | 184 | ||
@@ -188,7 +189,7 @@ static inline void pc87413_disable_sw_wd_tren(void) | |||
188 | /* Disable SW_WD_TREN */ | 189 | /* Disable SW_WD_TREN */ |
189 | outb_p(inb(swc_base_addr + WDCFG) & 0x7f, swc_base_addr + WDCFG); | 190 | outb_p(inb(swc_base_addr + WDCFG) & 0x7f, swc_base_addr + WDCFG); |
190 | #ifdef DEBUG | 191 | #ifdef DEBUG |
191 | printk(KERN_INFO DPFX "pc87413 - Disable SW_WD_TREN\n"); | 192 | pr_info(DPFX "pc87413 - Disable SW_WD_TREN\n"); |
192 | #endif | 193 | #endif |
193 | } | 194 | } |
194 | 195 | ||
@@ -199,7 +200,7 @@ static inline void pc87413_enable_sw_wd_trg(void) | |||
199 | /* Enable SW_WD_TRG */ | 200 | /* Enable SW_WD_TRG */ |
200 | outb_p(inb(swc_base_addr + WDCTL) | 0x80, swc_base_addr + WDCTL); | 201 | outb_p(inb(swc_base_addr + WDCTL) | 0x80, swc_base_addr + WDCTL); |
201 | #ifdef DEBUG | 202 | #ifdef DEBUG |
202 | printk(KERN_INFO DPFX "pc87413 - Enable SW_WD_TRG\n"); | 203 | pr_info(DPFX "pc87413 - Enable SW_WD_TRG\n"); |
203 | #endif | 204 | #endif |
204 | } | 205 | } |
205 | 206 | ||
@@ -210,7 +211,7 @@ static inline void pc87413_disable_sw_wd_trg(void) | |||
210 | /* Disable SW_WD_TRG */ | 211 | /* Disable SW_WD_TRG */ |
211 | outb_p(inb(swc_base_addr + WDCTL) & 0x7f, swc_base_addr + WDCTL); | 212 | outb_p(inb(swc_base_addr + WDCTL) & 0x7f, swc_base_addr + WDCTL); |
212 | #ifdef DEBUG | 213 | #ifdef DEBUG |
213 | printk(KERN_INFO DPFX "Disable SW_WD_TRG\n"); | 214 | pr_info(DPFX "Disable SW_WD_TRG\n"); |
214 | #endif | 215 | #endif |
215 | } | 216 | } |
216 | 217 | ||
@@ -284,8 +285,7 @@ static int pc87413_open(struct inode *inode, struct file *file) | |||
284 | /* Reload and activate timer */ | 285 | /* Reload and activate timer */ |
285 | pc87413_refresh(); | 286 | pc87413_refresh(); |
286 | 287 | ||
287 | printk(KERN_INFO MODNAME | 288 | pr_info("Watchdog enabled. Timeout set to %d minute(s).\n", timeout); |
288 | "Watchdog enabled. Timeout set to %d minute(s).\n", timeout); | ||
289 | 289 | ||
290 | return nonseekable_open(inode, file); | 290 | return nonseekable_open(inode, file); |
291 | } | 291 | } |
@@ -308,11 +308,9 @@ static int pc87413_release(struct inode *inode, struct file *file) | |||
308 | 308 | ||
309 | if (expect_close == 42) { | 309 | if (expect_close == 42) { |
310 | pc87413_disable(); | 310 | pc87413_disable(); |
311 | printk(KERN_INFO MODNAME | 311 | pr_info("Watchdog disabled, sleeping again...\n"); |
312 | "Watchdog disabled, sleeping again...\n"); | ||
313 | } else { | 312 | } else { |
314 | printk(KERN_CRIT MODNAME | 313 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
315 | "Unexpected close, not stopping watchdog!\n"); | ||
316 | pc87413_refresh(); | 314 | pc87413_refresh(); |
317 | } | 315 | } |
318 | clear_bit(0, &timer_enabled); | 316 | clear_bit(0, &timer_enabled); |
@@ -428,7 +426,7 @@ static long pc87413_ioctl(struct file *file, unsigned int cmd, | |||
428 | case WDIOC_KEEPALIVE: | 426 | case WDIOC_KEEPALIVE: |
429 | pc87413_refresh(); | 427 | pc87413_refresh(); |
430 | #ifdef DEBUG | 428 | #ifdef DEBUG |
431 | printk(KERN_INFO DPFX "keepalive\n"); | 429 | pr_info(DPFX "keepalive\n"); |
432 | #endif | 430 | #endif |
433 | return 0; | 431 | return 0; |
434 | case WDIOC_SETTIMEOUT: | 432 | case WDIOC_SETTIMEOUT: |
@@ -508,7 +506,7 @@ static int __init pc87413_init(void) | |||
508 | { | 506 | { |
509 | int ret; | 507 | int ret; |
510 | 508 | ||
511 | printk(KERN_INFO PFX "Version " VERSION " at io 0x%X\n", | 509 | pr_info("Version " VERSION " at io 0x%X\n", |
512 | WDT_INDEX_IO_PORT); | 510 | WDT_INDEX_IO_PORT); |
513 | 511 | ||
514 | if (!request_muxed_region(io, 2, MODNAME)) | 512 | if (!request_muxed_region(io, 2, MODNAME)) |
@@ -516,26 +514,23 @@ static int __init pc87413_init(void) | |||
516 | 514 | ||
517 | ret = register_reboot_notifier(&pc87413_notifier); | 515 | ret = register_reboot_notifier(&pc87413_notifier); |
518 | if (ret != 0) { | 516 | if (ret != 0) { |
519 | printk(KERN_ERR PFX | 517 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
520 | "cannot register reboot notifier (err=%d)\n", ret); | ||
521 | } | 518 | } |
522 | 519 | ||
523 | ret = misc_register(&pc87413_miscdev); | 520 | ret = misc_register(&pc87413_miscdev); |
524 | if (ret != 0) { | 521 | if (ret != 0) { |
525 | printk(KERN_ERR PFX | 522 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
526 | "cannot register miscdev on minor=%d (err=%d)\n", | 523 | WATCHDOG_MINOR, ret); |
527 | WATCHDOG_MINOR, ret); | ||
528 | goto reboot_unreg; | 524 | goto reboot_unreg; |
529 | } | 525 | } |
530 | printk(KERN_INFO PFX "initialized. timeout=%d min \n", timeout); | 526 | pr_info("initialized. timeout=%d min\n", timeout); |
531 | 527 | ||
532 | pc87413_select_wdt_out(); | 528 | pc87413_select_wdt_out(); |
533 | pc87413_enable_swc(); | 529 | pc87413_enable_swc(); |
534 | pc87413_get_swc_base_addr(); | 530 | pc87413_get_swc_base_addr(); |
535 | 531 | ||
536 | if (!request_region(swc_base_addr, 0x20, MODNAME)) { | 532 | if (!request_region(swc_base_addr, 0x20, MODNAME)) { |
537 | printk(KERN_ERR PFX | 533 | pr_err("cannot request SWC region at 0x%x\n", swc_base_addr); |
538 | "cannot request SWC region at 0x%x\n", swc_base_addr); | ||
539 | ret = -EBUSY; | 534 | ret = -EBUSY; |
540 | goto misc_unreg; | 535 | goto misc_unreg; |
541 | } | 536 | } |
@@ -568,14 +563,14 @@ static void __exit pc87413_exit(void) | |||
568 | /* Stop the timer before we leave */ | 563 | /* Stop the timer before we leave */ |
569 | if (!nowayout) { | 564 | if (!nowayout) { |
570 | pc87413_disable(); | 565 | pc87413_disable(); |
571 | printk(KERN_INFO MODNAME "Watchdog disabled.\n"); | 566 | pr_info("Watchdog disabled\n"); |
572 | } | 567 | } |
573 | 568 | ||
574 | misc_deregister(&pc87413_miscdev); | 569 | misc_deregister(&pc87413_miscdev); |
575 | unregister_reboot_notifier(&pc87413_notifier); | 570 | unregister_reboot_notifier(&pc87413_notifier); |
576 | release_region(swc_base_addr, 0x20); | 571 | release_region(swc_base_addr, 0x20); |
577 | 572 | ||
578 | printk(KERN_INFO MODNAME " watchdog component driver removed.\n"); | 573 | pr_info("watchdog component driver removed\n"); |
579 | } | 574 | } |
580 | 575 | ||
581 | module_init(pc87413_init); | 576 | module_init(pc87413_init); |
diff --git a/drivers/watchdog/pcwd.c b/drivers/watchdog/pcwd.c index 06f7922606c0..fe370defc71f 100644 --- a/drivers/watchdog/pcwd.c +++ b/drivers/watchdog/pcwd.c | |||
@@ -51,6 +51,8 @@ | |||
51 | * http://www.pcwatchdog.com/ | 51 | * http://www.pcwatchdog.com/ |
52 | */ | 52 | */ |
53 | 53 | ||
54 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
55 | |||
54 | #include <linux/module.h> /* For module specific items */ | 56 | #include <linux/module.h> /* For module specific items */ |
55 | #include <linux/moduleparam.h> /* For new moduleparam's */ | 57 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
56 | #include <linux/types.h> /* For standard types (like size_t) */ | 58 | #include <linux/types.h> /* For standard types (like size_t) */ |
@@ -75,7 +77,6 @@ | |||
75 | #define WATCHDOG_DATE "18 Feb 2007" | 77 | #define WATCHDOG_DATE "18 Feb 2007" |
76 | #define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog" | 78 | #define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog" |
77 | #define WATCHDOG_NAME "pcwd" | 79 | #define WATCHDOG_NAME "pcwd" |
78 | #define PFX WATCHDOG_NAME ": " | ||
79 | #define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n" | 80 | #define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n" |
80 | 81 | ||
81 | /* | 82 | /* |
@@ -220,8 +221,7 @@ static int send_isa_command(int cmd) | |||
220 | int port0, last_port0; /* Double read for stabilising */ | 221 | int port0, last_port0; /* Double read for stabilising */ |
221 | 222 | ||
222 | if (debug >= DEBUG) | 223 | if (debug >= DEBUG) |
223 | printk(KERN_DEBUG PFX "sending following data cmd=0x%02x\n", | 224 | pr_debug("sending following data cmd=0x%02x\n", cmd); |
224 | cmd); | ||
225 | 225 | ||
226 | /* The WCMD bit must be 1 and the command is only 4 bits in size */ | 226 | /* The WCMD bit must be 1 and the command is only 4 bits in size */ |
227 | control_status = (cmd & 0x0F) | WD_WCMD; | 227 | control_status = (cmd & 0x0F) | WD_WCMD; |
@@ -240,9 +240,8 @@ static int send_isa_command(int cmd) | |||
240 | } | 240 | } |
241 | 241 | ||
242 | if (debug >= DEBUG) | 242 | if (debug >= DEBUG) |
243 | printk(KERN_DEBUG PFX "received following data for " | 243 | pr_debug("received following data for cmd=0x%02x: port0=0x%02x last_port0=0x%02x\n", |
244 | "cmd=0x%02x: port0=0x%02x last_port0=0x%02x\n", | 244 | cmd, port0, last_port0); |
245 | cmd, port0, last_port0); | ||
246 | 245 | ||
247 | return port0; | 246 | return port0; |
248 | } | 247 | } |
@@ -271,8 +270,7 @@ static int set_command_mode(void) | |||
271 | pcwd_private.command_mode = found; | 270 | pcwd_private.command_mode = found; |
272 | 271 | ||
273 | if (debug >= DEBUG) | 272 | if (debug >= DEBUG) |
274 | printk(KERN_DEBUG PFX "command_mode=%d\n", | 273 | pr_debug("command_mode=%d\n", pcwd_private.command_mode); |
275 | pcwd_private.command_mode); | ||
276 | 274 | ||
277 | return found; | 275 | return found; |
278 | } | 276 | } |
@@ -288,8 +286,7 @@ static void unset_command_mode(void) | |||
288 | pcwd_private.command_mode = 0; | 286 | pcwd_private.command_mode = 0; |
289 | 287 | ||
290 | if (debug >= DEBUG) | 288 | if (debug >= DEBUG) |
291 | printk(KERN_DEBUG PFX "command_mode=%d\n", | 289 | pr_debug("command_mode=%d\n", pcwd_private.command_mode); |
292 | pcwd_private.command_mode); | ||
293 | } | 290 | } |
294 | 291 | ||
295 | static inline void pcwd_check_temperature_support(void) | 292 | static inline void pcwd_check_temperature_support(void) |
@@ -336,17 +333,14 @@ static void pcwd_show_card_info(void) | |||
336 | 333 | ||
337 | /* Get some extra info from the hardware (in command/debug/diag mode) */ | 334 | /* Get some extra info from the hardware (in command/debug/diag mode) */ |
338 | if (pcwd_private.revision == PCWD_REVISION_A) | 335 | if (pcwd_private.revision == PCWD_REVISION_A) |
339 | printk(KERN_INFO PFX | 336 | pr_info("ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", |
340 | "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", | 337 | pcwd_private.io_addr); |
341 | pcwd_private.io_addr); | ||
342 | else if (pcwd_private.revision == PCWD_REVISION_C) { | 338 | else if (pcwd_private.revision == PCWD_REVISION_C) { |
343 | pcwd_get_firmware(); | 339 | pcwd_get_firmware(); |
344 | printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port " | 340 | pr_info("ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n", |
345 | "0x%04x (Firmware version: %s)\n", | ||
346 | pcwd_private.io_addr, pcwd_private.fw_ver_str); | 341 | pcwd_private.io_addr, pcwd_private.fw_ver_str); |
347 | option_switches = pcwd_get_option_switches(); | 342 | option_switches = pcwd_get_option_switches(); |
348 | printk(KERN_INFO PFX "Option switches (0x%02x): " | 343 | pr_info("Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", |
349 | "Temperature Reset Enable=%s, Power On Delay=%s\n", | ||
350 | option_switches, | 344 | option_switches, |
351 | ((option_switches & 0x10) ? "ON" : "OFF"), | 345 | ((option_switches & 0x10) ? "ON" : "OFF"), |
352 | ((option_switches & 0x08) ? "ON" : "OFF")); | 346 | ((option_switches & 0x08) ? "ON" : "OFF")); |
@@ -359,22 +353,18 @@ static void pcwd_show_card_info(void) | |||
359 | } | 353 | } |
360 | 354 | ||
361 | if (pcwd_private.supports_temp) | 355 | if (pcwd_private.supports_temp) |
362 | printk(KERN_INFO PFX "Temperature Option Detected\n"); | 356 | pr_info("Temperature Option Detected\n"); |
363 | 357 | ||
364 | if (pcwd_private.boot_status & WDIOF_CARDRESET) | 358 | if (pcwd_private.boot_status & WDIOF_CARDRESET) |
365 | printk(KERN_INFO PFX | 359 | pr_info("Previous reboot was caused by the card\n"); |
366 | "Previous reboot was caused by the card\n"); | ||
367 | 360 | ||
368 | if (pcwd_private.boot_status & WDIOF_OVERHEAT) { | 361 | if (pcwd_private.boot_status & WDIOF_OVERHEAT) { |
369 | printk(KERN_EMERG PFX | 362 | pr_emerg("Card senses a CPU Overheat. Panicking!\n"); |
370 | "Card senses a CPU Overheat. Panicking!\n"); | 363 | pr_emerg("CPU Overheat\n"); |
371 | printk(KERN_EMERG PFX | ||
372 | "CPU Overheat\n"); | ||
373 | } | 364 | } |
374 | 365 | ||
375 | if (pcwd_private.boot_status == 0) | 366 | if (pcwd_private.boot_status == 0) |
376 | printk(KERN_INFO PFX | 367 | pr_info("No previous trip detected - Cold boot or reset\n"); |
377 | "No previous trip detected - Cold boot or reset\n"); | ||
378 | } | 368 | } |
379 | 369 | ||
380 | static void pcwd_timer_ping(unsigned long data) | 370 | static void pcwd_timer_ping(unsigned long data) |
@@ -404,8 +394,7 @@ static void pcwd_timer_ping(unsigned long data) | |||
404 | 394 | ||
405 | spin_unlock(&pcwd_private.io_lock); | 395 | spin_unlock(&pcwd_private.io_lock); |
406 | } else { | 396 | } else { |
407 | printk(KERN_WARNING PFX | 397 | pr_warn("Heartbeat lost! Will not ping the watchdog\n"); |
408 | "Heartbeat lost! Will not ping the watchdog\n"); | ||
409 | } | 398 | } |
410 | } | 399 | } |
411 | 400 | ||
@@ -426,13 +415,13 @@ static int pcwd_start(void) | |||
426 | stat_reg = inb_p(pcwd_private.io_addr + 2); | 415 | stat_reg = inb_p(pcwd_private.io_addr + 2); |
427 | spin_unlock(&pcwd_private.io_lock); | 416 | spin_unlock(&pcwd_private.io_lock); |
428 | if (stat_reg & WD_WDIS) { | 417 | if (stat_reg & WD_WDIS) { |
429 | printk(KERN_INFO PFX "Could not start watchdog\n"); | 418 | pr_info("Could not start watchdog\n"); |
430 | return -EIO; | 419 | return -EIO; |
431 | } | 420 | } |
432 | } | 421 | } |
433 | 422 | ||
434 | if (debug >= VERBOSE) | 423 | if (debug >= VERBOSE) |
435 | printk(KERN_DEBUG PFX "Watchdog started\n"); | 424 | pr_debug("Watchdog started\n"); |
436 | 425 | ||
437 | return 0; | 426 | return 0; |
438 | } | 427 | } |
@@ -454,13 +443,13 @@ static int pcwd_stop(void) | |||
454 | stat_reg = inb_p(pcwd_private.io_addr + 2); | 443 | stat_reg = inb_p(pcwd_private.io_addr + 2); |
455 | spin_unlock(&pcwd_private.io_lock); | 444 | spin_unlock(&pcwd_private.io_lock); |
456 | if ((stat_reg & WD_WDIS) == 0) { | 445 | if ((stat_reg & WD_WDIS) == 0) { |
457 | printk(KERN_INFO PFX "Could not stop watchdog\n"); | 446 | pr_info("Could not stop watchdog\n"); |
458 | return -EIO; | 447 | return -EIO; |
459 | } | 448 | } |
460 | } | 449 | } |
461 | 450 | ||
462 | if (debug >= VERBOSE) | 451 | if (debug >= VERBOSE) |
463 | printk(KERN_DEBUG PFX "Watchdog stopped\n"); | 452 | pr_debug("Watchdog stopped\n"); |
464 | 453 | ||
465 | return 0; | 454 | return 0; |
466 | } | 455 | } |
@@ -471,7 +460,7 @@ static int pcwd_keepalive(void) | |||
471 | pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ); | 460 | pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ); |
472 | 461 | ||
473 | if (debug >= DEBUG) | 462 | if (debug >= DEBUG) |
474 | printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n"); | 463 | pr_debug("Watchdog keepalive signal send\n"); |
475 | 464 | ||
476 | return 0; | 465 | return 0; |
477 | } | 466 | } |
@@ -484,8 +473,7 @@ static int pcwd_set_heartbeat(int t) | |||
484 | heartbeat = t; | 473 | heartbeat = t; |
485 | 474 | ||
486 | if (debug >= VERBOSE) | 475 | if (debug >= VERBOSE) |
487 | printk(KERN_DEBUG PFX "New heartbeat: %d\n", | 476 | pr_debug("New heartbeat: %d\n", heartbeat); |
488 | heartbeat); | ||
489 | 477 | ||
490 | return 0; | 478 | return 0; |
491 | } | 479 | } |
@@ -518,8 +506,7 @@ static int pcwd_get_status(int *status) | |||
518 | if (control_status & WD_T110) { | 506 | if (control_status & WD_T110) { |
519 | *status |= WDIOF_OVERHEAT; | 507 | *status |= WDIOF_OVERHEAT; |
520 | if (temp_panic) { | 508 | if (temp_panic) { |
521 | printk(KERN_INFO PFX | 509 | pr_info("Temperature overheat trip!\n"); |
522 | "Temperature overheat trip!\n"); | ||
523 | kernel_power_off(); | 510 | kernel_power_off(); |
524 | } | 511 | } |
525 | } | 512 | } |
@@ -530,8 +517,7 @@ static int pcwd_get_status(int *status) | |||
530 | if (control_status & WD_REVC_TTRP) { | 517 | if (control_status & WD_REVC_TTRP) { |
531 | *status |= WDIOF_OVERHEAT; | 518 | *status |= WDIOF_OVERHEAT; |
532 | if (temp_panic) { | 519 | if (temp_panic) { |
533 | printk(KERN_INFO PFX | 520 | pr_info("Temperature overheat trip!\n"); |
534 | "Temperature overheat trip!\n"); | ||
535 | kernel_power_off(); | 521 | kernel_power_off(); |
536 | } | 522 | } |
537 | } | 523 | } |
@@ -548,16 +534,14 @@ static int pcwd_clear_status(void) | |||
548 | spin_lock(&pcwd_private.io_lock); | 534 | spin_lock(&pcwd_private.io_lock); |
549 | 535 | ||
550 | if (debug >= VERBOSE) | 536 | if (debug >= VERBOSE) |
551 | printk(KERN_INFO PFX | 537 | pr_info("clearing watchdog trip status\n"); |
552 | "clearing watchdog trip status\n"); | ||
553 | 538 | ||
554 | control_status = inb_p(pcwd_private.io_addr + 1); | 539 | control_status = inb_p(pcwd_private.io_addr + 1); |
555 | 540 | ||
556 | if (debug >= DEBUG) { | 541 | if (debug >= DEBUG) { |
557 | printk(KERN_DEBUG PFX "status was: 0x%02x\n", | 542 | pr_debug("status was: 0x%02x\n", control_status); |
558 | control_status); | 543 | pr_debug("sending: 0x%02x\n", |
559 | printk(KERN_DEBUG PFX "sending: 0x%02x\n", | 544 | (control_status & WD_REVC_R2DS)); |
560 | (control_status & WD_REVC_R2DS)); | ||
561 | } | 545 | } |
562 | 546 | ||
563 | /* clear reset status & Keep Relay 2 disable state as it is */ | 547 | /* clear reset status & Keep Relay 2 disable state as it is */ |
@@ -588,8 +572,7 @@ static int pcwd_get_temperature(int *temperature) | |||
588 | spin_unlock(&pcwd_private.io_lock); | 572 | spin_unlock(&pcwd_private.io_lock); |
589 | 573 | ||
590 | if (debug >= DEBUG) { | 574 | if (debug >= DEBUG) { |
591 | printk(KERN_DEBUG PFX "temperature is: %d F\n", | 575 | pr_debug("temperature is: %d F\n", *temperature); |
592 | *temperature); | ||
593 | } | 576 | } |
594 | 577 | ||
595 | return 0; | 578 | return 0; |
@@ -720,8 +703,7 @@ static int pcwd_close(struct inode *inode, struct file *file) | |||
720 | if (expect_close == 42) | 703 | if (expect_close == 42) |
721 | pcwd_stop(); | 704 | pcwd_stop(); |
722 | else { | 705 | else { |
723 | printk(KERN_CRIT PFX | 706 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
724 | "Unexpected close, not stopping watchdog!\n"); | ||
725 | pcwd_keepalive(); | 707 | pcwd_keepalive(); |
726 | } | 708 | } |
727 | expect_close = 0; | 709 | expect_close = 0; |
@@ -828,11 +810,10 @@ static int __devinit pcwd_isa_match(struct device *dev, unsigned int id) | |||
828 | int retval; | 810 | int retval; |
829 | 811 | ||
830 | if (debug >= DEBUG) | 812 | if (debug >= DEBUG) |
831 | printk(KERN_DEBUG PFX "pcwd_isa_match id=%d\n", | 813 | pr_debug("pcwd_isa_match id=%d\n", id); |
832 | id); | ||
833 | 814 | ||
834 | if (!request_region(base_addr, 4, "PCWD")) { | 815 | if (!request_region(base_addr, 4, "PCWD")) { |
835 | printk(KERN_INFO PFX "Port 0x%04x unavailable\n", base_addr); | 816 | pr_info("Port 0x%04x unavailable\n", base_addr); |
836 | return 0; | 817 | return 0; |
837 | } | 818 | } |
838 | 819 | ||
@@ -870,21 +851,20 @@ static int __devinit pcwd_isa_probe(struct device *dev, unsigned int id) | |||
870 | int ret; | 851 | int ret; |
871 | 852 | ||
872 | if (debug >= DEBUG) | 853 | if (debug >= DEBUG) |
873 | printk(KERN_DEBUG PFX "pcwd_isa_probe id=%d\n", | 854 | pr_debug("pcwd_isa_probe id=%d\n", id); |
874 | id); | ||
875 | 855 | ||
876 | cards_found++; | 856 | cards_found++; |
877 | if (cards_found == 1) | 857 | if (cards_found == 1) |
878 | printk(KERN_INFO PFX "v%s Ken Hollis (kenji@bitgate.com)\n", | 858 | pr_info("v%s Ken Hollis (kenji@bitgate.com)\n", |
879 | WATCHDOG_VERSION); | 859 | WATCHDOG_VERSION); |
880 | 860 | ||
881 | if (cards_found > 1) { | 861 | if (cards_found > 1) { |
882 | printk(KERN_ERR PFX "This driver only supports 1 device\n"); | 862 | pr_err("This driver only supports 1 device\n"); |
883 | return -ENODEV; | 863 | return -ENODEV; |
884 | } | 864 | } |
885 | 865 | ||
886 | if (pcwd_ioports[id] == 0x0000) { | 866 | if (pcwd_ioports[id] == 0x0000) { |
887 | printk(KERN_ERR PFX "No I/O-Address for card detected\n"); | 867 | pr_err("No I/O-Address for card detected\n"); |
888 | return -ENODEV; | 868 | return -ENODEV; |
889 | } | 869 | } |
890 | pcwd_private.io_addr = pcwd_ioports[id]; | 870 | pcwd_private.io_addr = pcwd_ioports[id]; |
@@ -896,8 +876,8 @@ static int __devinit pcwd_isa_probe(struct device *dev, unsigned int id) | |||
896 | 876 | ||
897 | if (!request_region(pcwd_private.io_addr, | 877 | if (!request_region(pcwd_private.io_addr, |
898 | (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) { | 878 | (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) { |
899 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 879 | pr_err("I/O address 0x%04x already in use\n", |
900 | pcwd_private.io_addr); | 880 | pcwd_private.io_addr); |
901 | ret = -EIO; | 881 | ret = -EIO; |
902 | goto error_request_region; | 882 | goto error_request_region; |
903 | } | 883 | } |
@@ -932,30 +912,27 @@ static int __devinit pcwd_isa_probe(struct device *dev, unsigned int id) | |||
932 | if not reset to the default */ | 912 | if not reset to the default */ |
933 | if (pcwd_set_heartbeat(heartbeat)) { | 913 | if (pcwd_set_heartbeat(heartbeat)) { |
934 | pcwd_set_heartbeat(WATCHDOG_HEARTBEAT); | 914 | pcwd_set_heartbeat(WATCHDOG_HEARTBEAT); |
935 | printk(KERN_INFO PFX | 915 | pr_info("heartbeat value must be 2 <= heartbeat <= 7200, using %d\n", |
936 | "heartbeat value must be 2 <= heartbeat <= 7200, using %d\n", | 916 | WATCHDOG_HEARTBEAT); |
937 | WATCHDOG_HEARTBEAT); | ||
938 | } | 917 | } |
939 | 918 | ||
940 | if (pcwd_private.supports_temp) { | 919 | if (pcwd_private.supports_temp) { |
941 | ret = misc_register(&temp_miscdev); | 920 | ret = misc_register(&temp_miscdev); |
942 | if (ret) { | 921 | if (ret) { |
943 | printk(KERN_ERR PFX | 922 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
944 | "cannot register miscdev on minor=%d (err=%d)\n", | 923 | TEMP_MINOR, ret); |
945 | TEMP_MINOR, ret); | ||
946 | goto error_misc_register_temp; | 924 | goto error_misc_register_temp; |
947 | } | 925 | } |
948 | } | 926 | } |
949 | 927 | ||
950 | ret = misc_register(&pcwd_miscdev); | 928 | ret = misc_register(&pcwd_miscdev); |
951 | if (ret) { | 929 | if (ret) { |
952 | printk(KERN_ERR PFX | 930 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
953 | "cannot register miscdev on minor=%d (err=%d)\n", | 931 | WATCHDOG_MINOR, ret); |
954 | WATCHDOG_MINOR, ret); | ||
955 | goto error_misc_register_watchdog; | 932 | goto error_misc_register_watchdog; |
956 | } | 933 | } |
957 | 934 | ||
958 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 935 | pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", |
959 | heartbeat, nowayout); | 936 | heartbeat, nowayout); |
960 | 937 | ||
961 | return 0; | 938 | return 0; |
@@ -975,8 +952,7 @@ error_request_region: | |||
975 | static int __devexit pcwd_isa_remove(struct device *dev, unsigned int id) | 952 | static int __devexit pcwd_isa_remove(struct device *dev, unsigned int id) |
976 | { | 953 | { |
977 | if (debug >= DEBUG) | 954 | if (debug >= DEBUG) |
978 | printk(KERN_DEBUG PFX "pcwd_isa_remove id=%d\n", | 955 | pr_debug("pcwd_isa_remove id=%d\n", id); |
979 | id); | ||
980 | 956 | ||
981 | if (!pcwd_private.io_addr) | 957 | if (!pcwd_private.io_addr) |
982 | return 1; | 958 | return 1; |
@@ -1000,8 +976,7 @@ static int __devexit pcwd_isa_remove(struct device *dev, unsigned int id) | |||
1000 | static void pcwd_isa_shutdown(struct device *dev, unsigned int id) | 976 | static void pcwd_isa_shutdown(struct device *dev, unsigned int id) |
1001 | { | 977 | { |
1002 | if (debug >= DEBUG) | 978 | if (debug >= DEBUG) |
1003 | printk(KERN_DEBUG PFX "pcwd_isa_shutdown id=%d\n", | 979 | pr_debug("pcwd_isa_shutdown id=%d\n", id); |
1004 | id); | ||
1005 | 980 | ||
1006 | pcwd_stop(); | 981 | pcwd_stop(); |
1007 | } | 982 | } |
@@ -1025,7 +1000,7 @@ static int __init pcwd_init_module(void) | |||
1025 | static void __exit pcwd_cleanup_module(void) | 1000 | static void __exit pcwd_cleanup_module(void) |
1026 | { | 1001 | { |
1027 | isa_unregister_driver(&pcwd_isa_driver); | 1002 | isa_unregister_driver(&pcwd_isa_driver); |
1028 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 1003 | pr_info("Watchdog Module Unloaded\n"); |
1029 | } | 1004 | } |
1030 | 1005 | ||
1031 | module_init(pcwd_init_module); | 1006 | module_init(pcwd_init_module); |
diff --git a/drivers/watchdog/pcwd_pci.c b/drivers/watchdog/pcwd_pci.c index b8d14f88f0b5..75f2fa84c500 100644 --- a/drivers/watchdog/pcwd_pci.c +++ b/drivers/watchdog/pcwd_pci.c | |||
@@ -32,6 +32,8 @@ | |||
32 | * Includes, defines, variables, module parameters, ... | 32 | * Includes, defines, variables, module parameters, ... |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
36 | |||
35 | #include <linux/module.h> /* For module specific items */ | 37 | #include <linux/module.h> /* For module specific items */ |
36 | #include <linux/moduleparam.h> /* For new moduleparam's */ | 38 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
37 | #include <linux/types.h> /* For standard types (like size_t) */ | 39 | #include <linux/types.h> /* For standard types (like size_t) */ |
@@ -54,8 +56,7 @@ | |||
54 | #define WATCHDOG_VERSION "1.03" | 56 | #define WATCHDOG_VERSION "1.03" |
55 | #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" | 57 | #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" |
56 | #define WATCHDOG_NAME "pcwd_pci" | 58 | #define WATCHDOG_NAME "pcwd_pci" |
57 | #define PFX WATCHDOG_NAME ": " | 59 | #define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION |
58 | #define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n" | ||
59 | 60 | ||
60 | /* Stuff for the PCI ID's */ | 61 | /* Stuff for the PCI ID's */ |
61 | #ifndef PCI_VENDOR_ID_QUICKLOGIC | 62 | #ifndef PCI_VENDOR_ID_QUICKLOGIC |
@@ -159,8 +160,8 @@ static int send_command(int cmd, int *msb, int *lsb) | |||
159 | int got_response, count; | 160 | int got_response, count; |
160 | 161 | ||
161 | if (debug >= DEBUG) | 162 | if (debug >= DEBUG) |
162 | printk(KERN_DEBUG PFX "sending following data " | 163 | pr_debug("sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x\n", |
163 | "cmd=0x%02x msb=0x%02x lsb=0x%02x\n", cmd, *msb, *lsb); | 164 | cmd, *msb, *lsb); |
164 | 165 | ||
165 | spin_lock(&pcipcwd_private.io_lock); | 166 | spin_lock(&pcipcwd_private.io_lock); |
166 | /* If a command requires data it should be written first. | 167 | /* If a command requires data it should be written first. |
@@ -185,12 +186,10 @@ static int send_command(int cmd, int *msb, int *lsb) | |||
185 | 186 | ||
186 | if (debug >= DEBUG) { | 187 | if (debug >= DEBUG) { |
187 | if (got_response) { | 188 | if (got_response) { |
188 | printk(KERN_DEBUG PFX | 189 | pr_debug("time to process command was: %d ms\n", |
189 | "time to process command was: %d ms\n", | 190 | count); |
190 | count); | ||
191 | } else { | 191 | } else { |
192 | printk(KERN_DEBUG PFX | 192 | pr_debug("card did not respond on command!\n"); |
193 | "card did not respond on command!\n"); | ||
194 | } | 193 | } |
195 | } | 194 | } |
196 | 195 | ||
@@ -203,9 +202,8 @@ static int send_command(int cmd, int *msb, int *lsb) | |||
203 | inb_p(pcipcwd_private.io_addr + 6); | 202 | inb_p(pcipcwd_private.io_addr + 6); |
204 | 203 | ||
205 | if (debug >= DEBUG) | 204 | if (debug >= DEBUG) |
206 | printk(KERN_DEBUG PFX "received following data for " | 205 | pr_debug("received following data for cmd=0x%02x: msb=0x%02x lsb=0x%02x\n", |
207 | "cmd=0x%02x: msb=0x%02x lsb=0x%02x\n", | 206 | cmd, *msb, *lsb); |
208 | cmd, *msb, *lsb); | ||
209 | } | 207 | } |
210 | 208 | ||
211 | spin_unlock(&pcipcwd_private.io_lock); | 209 | spin_unlock(&pcipcwd_private.io_lock); |
@@ -243,27 +241,23 @@ static void pcipcwd_show_card_info(void) | |||
243 | /* Get switch settings */ | 241 | /* Get switch settings */ |
244 | option_switches = pcipcwd_get_option_switches(); | 242 | option_switches = pcipcwd_get_option_switches(); |
245 | 243 | ||
246 | printk(KERN_INFO PFX "Found card at port " | 244 | pr_info("Found card at port 0x%04x (Firmware: %s) %s temp option\n", |
247 | "0x%04x (Firmware: %s) %s temp option\n", | ||
248 | (int) pcipcwd_private.io_addr, fw_ver_str, | 245 | (int) pcipcwd_private.io_addr, fw_ver_str, |
249 | (pcipcwd_private.supports_temp ? "with" : "without")); | 246 | (pcipcwd_private.supports_temp ? "with" : "without")); |
250 | 247 | ||
251 | printk(KERN_INFO PFX "Option switches (0x%02x): " | 248 | pr_info("Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", |
252 | "Temperature Reset Enable=%s, Power On Delay=%s\n", | ||
253 | option_switches, | 249 | option_switches, |
254 | ((option_switches & 0x10) ? "ON" : "OFF"), | 250 | ((option_switches & 0x10) ? "ON" : "OFF"), |
255 | ((option_switches & 0x08) ? "ON" : "OFF")); | 251 | ((option_switches & 0x08) ? "ON" : "OFF")); |
256 | 252 | ||
257 | if (pcipcwd_private.boot_status & WDIOF_CARDRESET) | 253 | if (pcipcwd_private.boot_status & WDIOF_CARDRESET) |
258 | printk(KERN_INFO PFX | 254 | pr_info("Previous reset was caused by the Watchdog card\n"); |
259 | "Previous reset was caused by the Watchdog card\n"); | ||
260 | 255 | ||
261 | if (pcipcwd_private.boot_status & WDIOF_OVERHEAT) | 256 | if (pcipcwd_private.boot_status & WDIOF_OVERHEAT) |
262 | printk(KERN_INFO PFX "Card sensed a CPU Overheat\n"); | 257 | pr_info("Card sensed a CPU Overheat\n"); |
263 | 258 | ||
264 | if (pcipcwd_private.boot_status == 0) | 259 | if (pcipcwd_private.boot_status == 0) |
265 | printk(KERN_INFO PFX | 260 | pr_info("No previous trip detected - Cold boot or reset\n"); |
266 | "No previous trip detected - Cold boot or reset\n"); | ||
267 | } | 261 | } |
268 | 262 | ||
269 | static int pcipcwd_start(void) | 263 | static int pcipcwd_start(void) |
@@ -278,12 +272,12 @@ static int pcipcwd_start(void) | |||
278 | spin_unlock(&pcipcwd_private.io_lock); | 272 | spin_unlock(&pcipcwd_private.io_lock); |
279 | 273 | ||
280 | if (stat_reg & WD_PCI_WDIS) { | 274 | if (stat_reg & WD_PCI_WDIS) { |
281 | printk(KERN_ERR PFX "Card timer not enabled\n"); | 275 | pr_err("Card timer not enabled\n"); |
282 | return -1; | 276 | return -1; |
283 | } | 277 | } |
284 | 278 | ||
285 | if (debug >= VERBOSE) | 279 | if (debug >= VERBOSE) |
286 | printk(KERN_DEBUG PFX "Watchdog started\n"); | 280 | pr_debug("Watchdog started\n"); |
287 | 281 | ||
288 | return 0; | 282 | return 0; |
289 | } | 283 | } |
@@ -303,13 +297,12 @@ static int pcipcwd_stop(void) | |||
303 | spin_unlock(&pcipcwd_private.io_lock); | 297 | spin_unlock(&pcipcwd_private.io_lock); |
304 | 298 | ||
305 | if (!(stat_reg & WD_PCI_WDIS)) { | 299 | if (!(stat_reg & WD_PCI_WDIS)) { |
306 | printk(KERN_ERR PFX | 300 | pr_err("Card did not acknowledge disable attempt\n"); |
307 | "Card did not acknowledge disable attempt\n"); | ||
308 | return -1; | 301 | return -1; |
309 | } | 302 | } |
310 | 303 | ||
311 | if (debug >= VERBOSE) | 304 | if (debug >= VERBOSE) |
312 | printk(KERN_DEBUG PFX "Watchdog stopped\n"); | 305 | pr_debug("Watchdog stopped\n"); |
313 | 306 | ||
314 | return 0; | 307 | return 0; |
315 | } | 308 | } |
@@ -322,7 +315,7 @@ static int pcipcwd_keepalive(void) | |||
322 | spin_unlock(&pcipcwd_private.io_lock); | 315 | spin_unlock(&pcipcwd_private.io_lock); |
323 | 316 | ||
324 | if (debug >= DEBUG) | 317 | if (debug >= DEBUG) |
325 | printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n"); | 318 | pr_debug("Watchdog keepalive signal send\n"); |
326 | 319 | ||
327 | return 0; | 320 | return 0; |
328 | } | 321 | } |
@@ -340,8 +333,7 @@ static int pcipcwd_set_heartbeat(int t) | |||
340 | 333 | ||
341 | heartbeat = t; | 334 | heartbeat = t; |
342 | if (debug >= VERBOSE) | 335 | if (debug >= VERBOSE) |
343 | printk(KERN_DEBUG PFX "New heartbeat: %d\n", | 336 | pr_debug("New heartbeat: %d\n", heartbeat); |
344 | heartbeat); | ||
345 | 337 | ||
346 | return 0; | 338 | return 0; |
347 | } | 339 | } |
@@ -357,12 +349,11 @@ static int pcipcwd_get_status(int *status) | |||
357 | if (control_status & WD_PCI_TTRP) { | 349 | if (control_status & WD_PCI_TTRP) { |
358 | *status |= WDIOF_OVERHEAT; | 350 | *status |= WDIOF_OVERHEAT; |
359 | if (temp_panic) | 351 | if (temp_panic) |
360 | panic(PFX "Temperature overheat trip!\n"); | 352 | panic(KBUILD_MODNAME ": Temperature overheat trip!\n"); |
361 | } | 353 | } |
362 | 354 | ||
363 | if (debug >= DEBUG) | 355 | if (debug >= DEBUG) |
364 | printk(KERN_DEBUG PFX "Control Status #1: 0x%02x\n", | 356 | pr_debug("Control Status #1: 0x%02x\n", control_status); |
365 | control_status); | ||
366 | 357 | ||
367 | return 0; | 358 | return 0; |
368 | } | 359 | } |
@@ -374,14 +365,14 @@ static int pcipcwd_clear_status(void) | |||
374 | int reset_counter; | 365 | int reset_counter; |
375 | 366 | ||
376 | if (debug >= VERBOSE) | 367 | if (debug >= VERBOSE) |
377 | printk(KERN_INFO PFX "clearing watchdog trip status & LED\n"); | 368 | pr_info("clearing watchdog trip status & LED\n"); |
378 | 369 | ||
379 | control_status = inb_p(pcipcwd_private.io_addr + 1); | 370 | control_status = inb_p(pcipcwd_private.io_addr + 1); |
380 | 371 | ||
381 | if (debug >= DEBUG) { | 372 | if (debug >= DEBUG) { |
382 | printk(KERN_DEBUG PFX "status was: 0x%02x\n", control_status); | 373 | pr_debug("status was: 0x%02x\n", control_status); |
383 | printk(KERN_DEBUG PFX "sending: 0x%02x\n", | 374 | pr_debug("sending: 0x%02x\n", |
384 | (control_status & WD_PCI_R2DS) | WD_PCI_WTRP); | 375 | (control_status & WD_PCI_R2DS) | WD_PCI_WTRP); |
385 | } | 376 | } |
386 | 377 | ||
387 | /* clear trip status & LED and keep mode of relay 2 */ | 378 | /* clear trip status & LED and keep mode of relay 2 */ |
@@ -394,8 +385,7 @@ static int pcipcwd_clear_status(void) | |||
394 | send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter); | 385 | send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter); |
395 | 386 | ||
396 | if (debug >= DEBUG) { | 387 | if (debug >= DEBUG) { |
397 | printk(KERN_DEBUG PFX "reset count was: 0x%02x\n", | 388 | pr_debug("reset count was: 0x%02x\n", reset_counter); |
398 | reset_counter); | ||
399 | } | 389 | } |
400 | 390 | ||
401 | return 0; | 391 | return 0; |
@@ -418,8 +408,7 @@ static int pcipcwd_get_temperature(int *temperature) | |||
418 | *temperature = (*temperature * 9 / 5) + 32; | 408 | *temperature = (*temperature * 9 / 5) + 32; |
419 | 409 | ||
420 | if (debug >= DEBUG) { | 410 | if (debug >= DEBUG) { |
421 | printk(KERN_DEBUG PFX "temperature is: %d F\n", | 411 | pr_debug("temperature is: %d F\n", *temperature); |
422 | *temperature); | ||
423 | } | 412 | } |
424 | 413 | ||
425 | return 0; | 414 | return 0; |
@@ -437,8 +426,7 @@ static int pcipcwd_get_timeleft(int *time_left) | |||
437 | *time_left = (msb << 8) + lsb; | 426 | *time_left = (msb << 8) + lsb; |
438 | 427 | ||
439 | if (debug >= VERBOSE) | 428 | if (debug >= VERBOSE) |
440 | printk(KERN_DEBUG PFX "Time left before next reboot: %d\n", | 429 | pr_debug("Time left before next reboot: %d\n", *time_left); |
441 | *time_left); | ||
442 | 430 | ||
443 | return 0; | 431 | return 0; |
444 | } | 432 | } |
@@ -583,8 +571,7 @@ static int pcipcwd_open(struct inode *inode, struct file *file) | |||
583 | /* /dev/watchdog can only be opened once */ | 571 | /* /dev/watchdog can only be opened once */ |
584 | if (test_and_set_bit(0, &is_active)) { | 572 | if (test_and_set_bit(0, &is_active)) { |
585 | if (debug >= VERBOSE) | 573 | if (debug >= VERBOSE) |
586 | printk(KERN_ERR PFX | 574 | pr_err("Attempt to open already opened device\n"); |
587 | "Attempt to open already opened device.\n"); | ||
588 | return -EBUSY; | 575 | return -EBUSY; |
589 | } | 576 | } |
590 | 577 | ||
@@ -602,8 +589,7 @@ static int pcipcwd_release(struct inode *inode, struct file *file) | |||
602 | if (expect_release == 42) { | 589 | if (expect_release == 42) { |
603 | pcipcwd_stop(); | 590 | pcipcwd_stop(); |
604 | } else { | 591 | } else { |
605 | printk(KERN_CRIT PFX | 592 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
606 | "Unexpected close, not stopping watchdog!\n"); | ||
607 | pcipcwd_keepalive(); | 593 | pcipcwd_keepalive(); |
608 | } | 594 | } |
609 | expect_release = 0; | 595 | expect_release = 0; |
@@ -703,20 +689,20 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev, | |||
703 | 689 | ||
704 | cards_found++; | 690 | cards_found++; |
705 | if (cards_found == 1) | 691 | if (cards_found == 1) |
706 | printk(KERN_INFO PFX DRIVER_VERSION); | 692 | pr_info("%s\n", DRIVER_VERSION); |
707 | 693 | ||
708 | if (cards_found > 1) { | 694 | if (cards_found > 1) { |
709 | printk(KERN_ERR PFX "This driver only supports 1 device\n"); | 695 | pr_err("This driver only supports 1 device\n"); |
710 | return -ENODEV; | 696 | return -ENODEV; |
711 | } | 697 | } |
712 | 698 | ||
713 | if (pci_enable_device(pdev)) { | 699 | if (pci_enable_device(pdev)) { |
714 | printk(KERN_ERR PFX "Not possible to enable PCI Device\n"); | 700 | pr_err("Not possible to enable PCI Device\n"); |
715 | return -ENODEV; | 701 | return -ENODEV; |
716 | } | 702 | } |
717 | 703 | ||
718 | if (pci_resource_start(pdev, 0) == 0x0000) { | 704 | if (pci_resource_start(pdev, 0) == 0x0000) { |
719 | printk(KERN_ERR PFX "No I/O-Address for card detected\n"); | 705 | pr_err("No I/O-Address for card detected\n"); |
720 | ret = -ENODEV; | 706 | ret = -ENODEV; |
721 | goto err_out_disable_device; | 707 | goto err_out_disable_device; |
722 | } | 708 | } |
@@ -725,8 +711,8 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev, | |||
725 | pcipcwd_private.io_addr = pci_resource_start(pdev, 0); | 711 | pcipcwd_private.io_addr = pci_resource_start(pdev, 0); |
726 | 712 | ||
727 | if (pci_request_regions(pdev, WATCHDOG_NAME)) { | 713 | if (pci_request_regions(pdev, WATCHDOG_NAME)) { |
728 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 714 | pr_err("I/O address 0x%04x already in use\n", |
729 | (int) pcipcwd_private.io_addr); | 715 | (int) pcipcwd_private.io_addr); |
730 | ret = -EIO; | 716 | ret = -EIO; |
731 | goto err_out_disable_device; | 717 | goto err_out_disable_device; |
732 | } | 718 | } |
@@ -755,36 +741,33 @@ static int __devinit pcipcwd_card_init(struct pci_dev *pdev, | |||
755 | * if not reset to the default */ | 741 | * if not reset to the default */ |
756 | if (pcipcwd_set_heartbeat(heartbeat)) { | 742 | if (pcipcwd_set_heartbeat(heartbeat)) { |
757 | pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT); | 743 | pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT); |
758 | printk(KERN_INFO PFX | 744 | pr_info("heartbeat value must be 0<heartbeat<65536, using %d\n", |
759 | "heartbeat value must be 0<heartbeat<65536, using %d\n", | ||
760 | WATCHDOG_HEARTBEAT); | 745 | WATCHDOG_HEARTBEAT); |
761 | } | 746 | } |
762 | 747 | ||
763 | ret = register_reboot_notifier(&pcipcwd_notifier); | 748 | ret = register_reboot_notifier(&pcipcwd_notifier); |
764 | if (ret != 0) { | 749 | if (ret != 0) { |
765 | printk(KERN_ERR PFX | 750 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
766 | "cannot register reboot notifier (err=%d)\n", ret); | ||
767 | goto err_out_release_region; | 751 | goto err_out_release_region; |
768 | } | 752 | } |
769 | 753 | ||
770 | if (pcipcwd_private.supports_temp) { | 754 | if (pcipcwd_private.supports_temp) { |
771 | ret = misc_register(&pcipcwd_temp_miscdev); | 755 | ret = misc_register(&pcipcwd_temp_miscdev); |
772 | if (ret != 0) { | 756 | if (ret != 0) { |
773 | printk(KERN_ERR PFX "cannot register miscdev on " | 757 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
774 | "minor=%d (err=%d)\n", TEMP_MINOR, ret); | 758 | TEMP_MINOR, ret); |
775 | goto err_out_unregister_reboot; | 759 | goto err_out_unregister_reboot; |
776 | } | 760 | } |
777 | } | 761 | } |
778 | 762 | ||
779 | ret = misc_register(&pcipcwd_miscdev); | 763 | ret = misc_register(&pcipcwd_miscdev); |
780 | if (ret != 0) { | 764 | if (ret != 0) { |
781 | printk(KERN_ERR PFX | 765 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
782 | "cannot register miscdev on minor=%d (err=%d)\n", | 766 | WATCHDOG_MINOR, ret); |
783 | WATCHDOG_MINOR, ret); | ||
784 | goto err_out_misc_deregister; | 767 | goto err_out_misc_deregister; |
785 | } | 768 | } |
786 | 769 | ||
787 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 770 | pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", |
788 | heartbeat, nowayout); | 771 | heartbeat, nowayout); |
789 | 772 | ||
790 | return 0; | 773 | return 0; |
@@ -842,7 +825,7 @@ static void __exit pcipcwd_cleanup_module(void) | |||
842 | { | 825 | { |
843 | pci_unregister_driver(&pcipcwd_driver); | 826 | pci_unregister_driver(&pcipcwd_driver); |
844 | 827 | ||
845 | printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); | 828 | pr_info("Watchdog Module Unloaded\n"); |
846 | } | 829 | } |
847 | 830 | ||
848 | module_init(pcipcwd_init_module); | 831 | module_init(pcipcwd_init_module); |
diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c index d8de1ddd176a..3e66a6bbfec5 100644 --- a/drivers/watchdog/pcwd_usb.c +++ b/drivers/watchdog/pcwd_usb.c | |||
@@ -24,6 +24,8 @@ | |||
24 | * http://www.berkprod.com/ or http://www.pcwatchdog.com/ | 24 | * http://www.berkprod.com/ or http://www.pcwatchdog.com/ |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
28 | |||
27 | #include <linux/module.h> /* For module specific items */ | 29 | #include <linux/module.h> /* For module specific items */ |
28 | #include <linux/moduleparam.h> /* For new moduleparam's */ | 30 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
29 | #include <linux/types.h> /* For standard types (like size_t) */ | 31 | #include <linux/types.h> /* For standard types (like size_t) */ |
@@ -42,17 +44,23 @@ | |||
42 | #include <linux/hid.h> /* For HID_REQ_SET_REPORT & HID_DT_REPORT */ | 44 | #include <linux/hid.h> /* For HID_REQ_SET_REPORT & HID_DT_REPORT */ |
43 | #include <linux/uaccess.h> /* For copy_to_user/put_user/... */ | 45 | #include <linux/uaccess.h> /* For copy_to_user/put_user/... */ |
44 | 46 | ||
45 | |||
46 | #ifdef CONFIG_USB_DEBUG | 47 | #ifdef CONFIG_USB_DEBUG |
47 | static int debug = 1; | 48 | static int debug = 1; |
48 | #else | 49 | #else |
49 | static int debug; | 50 | static int debug; |
50 | #endif | 51 | #endif |
51 | 52 | ||
52 | /* Use our own dbg macro */ | 53 | /* Use our own dbg macro */ |
54 | |||
53 | #undef dbg | 55 | #undef dbg |
54 | #define dbg(format, arg...) \ | 56 | #ifndef DEBUG |
55 | do { if (debug) printk(KERN_DEBUG PFX format "\n" , ## arg); } while (0) | 57 | #define DEBUG |
58 | #endif | ||
59 | #define dbg(format, ...) \ | ||
60 | do { \ | ||
61 | if (debug) \ | ||
62 | pr_debug(format "\n", ##__VA_ARGS__); \ | ||
63 | } while (0) | ||
56 | 64 | ||
57 | /* Module and Version Information */ | 65 | /* Module and Version Information */ |
58 | #define DRIVER_VERSION "1.02" | 66 | #define DRIVER_VERSION "1.02" |
@@ -60,7 +68,6 @@ | |||
60 | #define DRIVER_DESC "Berkshire USB-PC Watchdog driver" | 68 | #define DRIVER_DESC "Berkshire USB-PC Watchdog driver" |
61 | #define DRIVER_LICENSE "GPL" | 69 | #define DRIVER_LICENSE "GPL" |
62 | #define DRIVER_NAME "pcwd_usb" | 70 | #define DRIVER_NAME "pcwd_usb" |
63 | #define PFX DRIVER_NAME ": " | ||
64 | 71 | ||
65 | MODULE_AUTHOR(DRIVER_AUTHOR); | 72 | MODULE_AUTHOR(DRIVER_AUTHOR); |
66 | MODULE_DESCRIPTION(DRIVER_DESC); | 73 | MODULE_DESCRIPTION(DRIVER_DESC); |
@@ -220,8 +227,8 @@ static void usb_pcwd_intr_done(struct urb *urb) | |||
220 | resubmit: | 227 | resubmit: |
221 | retval = usb_submit_urb(urb, GFP_ATOMIC); | 228 | retval = usb_submit_urb(urb, GFP_ATOMIC); |
222 | if (retval) | 229 | if (retval) |
223 | printk(KERN_ERR PFX "can't resubmit intr, " | 230 | pr_err("can't resubmit intr, usb_submit_urb failed with result %d\n", |
224 | "usb_submit_urb failed with result %d\n", retval); | 231 | retval); |
225 | } | 232 | } |
226 | 233 | ||
227 | static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, | 234 | static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, |
@@ -284,8 +291,7 @@ static int usb_pcwd_start(struct usb_pcwd_private *usb_pcwd) | |||
284 | &msb, &lsb); | 291 | &msb, &lsb); |
285 | 292 | ||
286 | if ((retval == 0) || (lsb == 0)) { | 293 | if ((retval == 0) || (lsb == 0)) { |
287 | printk(KERN_ERR PFX | 294 | pr_err("Card did not acknowledge enable attempt\n"); |
288 | "Card did not acknowledge enable attempt\n"); | ||
289 | return -1; | 295 | return -1; |
290 | } | 296 | } |
291 | 297 | ||
@@ -303,8 +309,7 @@ static int usb_pcwd_stop(struct usb_pcwd_private *usb_pcwd) | |||
303 | &msb, &lsb); | 309 | &msb, &lsb); |
304 | 310 | ||
305 | if ((retval == 0) || (lsb != 0)) { | 311 | if ((retval == 0) || (lsb != 0)) { |
306 | printk(KERN_ERR PFX | 312 | pr_err("Card did not acknowledge disable attempt\n"); |
307 | "Card did not acknowledge disable attempt\n"); | ||
308 | return -1; | 313 | return -1; |
309 | } | 314 | } |
310 | 315 | ||
@@ -506,8 +511,7 @@ static int usb_pcwd_release(struct inode *inode, struct file *file) | |||
506 | if (expect_release == 42) { | 511 | if (expect_release == 42) { |
507 | usb_pcwd_stop(usb_pcwd_device); | 512 | usb_pcwd_stop(usb_pcwd_device); |
508 | } else { | 513 | } else { |
509 | printk(KERN_CRIT PFX | 514 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
510 | "Unexpected close, not stopping watchdog!\n"); | ||
511 | usb_pcwd_keepalive(usb_pcwd_device); | 515 | usb_pcwd_keepalive(usb_pcwd_device); |
512 | } | 516 | } |
513 | expect_release = 0; | 517 | expect_release = 0; |
@@ -627,7 +631,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, | |||
627 | 631 | ||
628 | cards_found++; | 632 | cards_found++; |
629 | if (cards_found > 1) { | 633 | if (cards_found > 1) { |
630 | printk(KERN_ERR PFX "This driver only supports 1 device\n"); | 634 | pr_err("This driver only supports 1 device\n"); |
631 | return -ENODEV; | 635 | return -ENODEV; |
632 | } | 636 | } |
633 | 637 | ||
@@ -636,8 +640,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, | |||
636 | 640 | ||
637 | /* check out that we have a HID device */ | 641 | /* check out that we have a HID device */ |
638 | if (!(iface_desc->desc.bInterfaceClass == USB_CLASS_HID)) { | 642 | if (!(iface_desc->desc.bInterfaceClass == USB_CLASS_HID)) { |
639 | printk(KERN_ERR PFX | 643 | pr_err("The device isn't a Human Interface Device\n"); |
640 | "The device isn't a Human Interface Device\n"); | ||
641 | return -ENODEV; | 644 | return -ENODEV; |
642 | } | 645 | } |
643 | 646 | ||
@@ -646,7 +649,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, | |||
646 | 649 | ||
647 | if (!usb_endpoint_is_int_in(endpoint)) { | 650 | if (!usb_endpoint_is_int_in(endpoint)) { |
648 | /* we didn't find a Interrupt endpoint with direction IN */ | 651 | /* we didn't find a Interrupt endpoint with direction IN */ |
649 | printk(KERN_ERR PFX "Couldn't find an INTR & IN endpoint\n"); | 652 | pr_err("Couldn't find an INTR & IN endpoint\n"); |
650 | return -ENODEV; | 653 | return -ENODEV; |
651 | } | 654 | } |
652 | 655 | ||
@@ -657,7 +660,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, | |||
657 | /* allocate memory for our device and initialize it */ | 660 | /* allocate memory for our device and initialize it */ |
658 | usb_pcwd = kzalloc(sizeof(struct usb_pcwd_private), GFP_KERNEL); | 661 | usb_pcwd = kzalloc(sizeof(struct usb_pcwd_private), GFP_KERNEL); |
659 | if (usb_pcwd == NULL) { | 662 | if (usb_pcwd == NULL) { |
660 | printk(KERN_ERR PFX "Out of memory\n"); | 663 | pr_err("Out of memory\n"); |
661 | goto error; | 664 | goto error; |
662 | } | 665 | } |
663 | 666 | ||
@@ -674,14 +677,14 @@ static int usb_pcwd_probe(struct usb_interface *interface, | |||
674 | usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size, | 677 | usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size, |
675 | GFP_ATOMIC, &usb_pcwd->intr_dma); | 678 | GFP_ATOMIC, &usb_pcwd->intr_dma); |
676 | if (!usb_pcwd->intr_buffer) { | 679 | if (!usb_pcwd->intr_buffer) { |
677 | printk(KERN_ERR PFX "Out of memory\n"); | 680 | pr_err("Out of memory\n"); |
678 | goto error; | 681 | goto error; |
679 | } | 682 | } |
680 | 683 | ||
681 | /* allocate the urb's */ | 684 | /* allocate the urb's */ |
682 | usb_pcwd->intr_urb = usb_alloc_urb(0, GFP_KERNEL); | 685 | usb_pcwd->intr_urb = usb_alloc_urb(0, GFP_KERNEL); |
683 | if (!usb_pcwd->intr_urb) { | 686 | if (!usb_pcwd->intr_urb) { |
684 | printk(KERN_ERR PFX "Out of memory\n"); | 687 | pr_err("Out of memory\n"); |
685 | goto error; | 688 | goto error; |
686 | } | 689 | } |
687 | 690 | ||
@@ -694,7 +697,7 @@ static int usb_pcwd_probe(struct usb_interface *interface, | |||
694 | 697 | ||
695 | /* register our interrupt URB with the USB system */ | 698 | /* register our interrupt URB with the USB system */ |
696 | if (usb_submit_urb(usb_pcwd->intr_urb, GFP_KERNEL)) { | 699 | if (usb_submit_urb(usb_pcwd->intr_urb, GFP_KERNEL)) { |
697 | printk(KERN_ERR PFX "Problem registering interrupt URB\n"); | 700 | pr_err("Problem registering interrupt URB\n"); |
698 | retval = -EIO; /* failure */ | 701 | retval = -EIO; /* failure */ |
699 | goto error; | 702 | goto error; |
700 | } | 703 | } |
@@ -713,15 +716,13 @@ static int usb_pcwd_probe(struct usb_interface *interface, | |||
713 | else | 716 | else |
714 | sprintf(fw_ver_str, "<card no answer>"); | 717 | sprintf(fw_ver_str, "<card no answer>"); |
715 | 718 | ||
716 | printk(KERN_INFO PFX "Found card (Firmware: %s) with temp option\n", | 719 | pr_info("Found card (Firmware: %s) with temp option\n", fw_ver_str); |
717 | fw_ver_str); | ||
718 | 720 | ||
719 | /* Get switch settings */ | 721 | /* Get switch settings */ |
720 | usb_pcwd_send_command(usb_pcwd, CMD_GET_DIP_SWITCH_SETTINGS, &dummy, | 722 | usb_pcwd_send_command(usb_pcwd, CMD_GET_DIP_SWITCH_SETTINGS, &dummy, |
721 | &option_switches); | 723 | &option_switches); |
722 | 724 | ||
723 | printk(KERN_INFO PFX "Option switches (0x%02x): " | 725 | pr_info("Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", |
724 | "Temperature Reset Enable=%s, Power On Delay=%s\n", | ||
725 | option_switches, | 726 | option_switches, |
726 | ((option_switches & 0x10) ? "ON" : "OFF"), | 727 | ((option_switches & 0x10) ? "ON" : "OFF"), |
727 | ((option_switches & 0x08) ? "ON" : "OFF")); | 728 | ((option_switches & 0x08) ? "ON" : "OFF")); |
@@ -734,39 +735,34 @@ static int usb_pcwd_probe(struct usb_interface *interface, | |||
734 | * if not reset to the default */ | 735 | * if not reset to the default */ |
735 | if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) { | 736 | if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) { |
736 | usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT); | 737 | usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT); |
737 | printk(KERN_INFO PFX | 738 | pr_info("heartbeat value must be 0<heartbeat<65536, using %d\n", |
738 | "heartbeat value must be 0<heartbeat<65536, using %d\n", | ||
739 | WATCHDOG_HEARTBEAT); | 739 | WATCHDOG_HEARTBEAT); |
740 | } | 740 | } |
741 | 741 | ||
742 | retval = register_reboot_notifier(&usb_pcwd_notifier); | 742 | retval = register_reboot_notifier(&usb_pcwd_notifier); |
743 | if (retval != 0) { | 743 | if (retval != 0) { |
744 | printk(KERN_ERR PFX | 744 | pr_err("cannot register reboot notifier (err=%d)\n", retval); |
745 | "cannot register reboot notifier (err=%d)\n", | ||
746 | retval); | ||
747 | goto error; | 745 | goto error; |
748 | } | 746 | } |
749 | 747 | ||
750 | retval = misc_register(&usb_pcwd_temperature_miscdev); | 748 | retval = misc_register(&usb_pcwd_temperature_miscdev); |
751 | if (retval != 0) { | 749 | if (retval != 0) { |
752 | printk(KERN_ERR PFX | 750 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
753 | "cannot register miscdev on minor=%d (err=%d)\n", | 751 | TEMP_MINOR, retval); |
754 | TEMP_MINOR, retval); | ||
755 | goto err_out_unregister_reboot; | 752 | goto err_out_unregister_reboot; |
756 | } | 753 | } |
757 | 754 | ||
758 | retval = misc_register(&usb_pcwd_miscdev); | 755 | retval = misc_register(&usb_pcwd_miscdev); |
759 | if (retval != 0) { | 756 | if (retval != 0) { |
760 | printk(KERN_ERR PFX | 757 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
761 | "cannot register miscdev on minor=%d (err=%d)\n", | 758 | WATCHDOG_MINOR, retval); |
762 | WATCHDOG_MINOR, retval); | ||
763 | goto err_out_misc_deregister; | 759 | goto err_out_misc_deregister; |
764 | } | 760 | } |
765 | 761 | ||
766 | /* we can register the device now, as it is ready */ | 762 | /* we can register the device now, as it is ready */ |
767 | usb_set_intfdata(interface, usb_pcwd); | 763 | usb_set_intfdata(interface, usb_pcwd); |
768 | 764 | ||
769 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 765 | pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", |
770 | heartbeat, nowayout); | 766 | heartbeat, nowayout); |
771 | 767 | ||
772 | return 0; | 768 | return 0; |
@@ -824,7 +820,7 @@ static void usb_pcwd_disconnect(struct usb_interface *interface) | |||
824 | 820 | ||
825 | mutex_unlock(&disconnect_mutex); | 821 | mutex_unlock(&disconnect_mutex); |
826 | 822 | ||
827 | printk(KERN_INFO PFX "USB PC Watchdog disconnected\n"); | 823 | pr_info("USB PC Watchdog disconnected\n"); |
828 | } | 824 | } |
829 | 825 | ||
830 | module_usb_driver(usb_pcwd_driver); | 826 | module_usb_driver(usb_pcwd_driver); |
diff --git a/drivers/watchdog/pika_wdt.c b/drivers/watchdog/pika_wdt.c index 2d22e996e996..e2877623ac44 100644 --- a/drivers/watchdog/pika_wdt.c +++ b/drivers/watchdog/pika_wdt.c | |||
@@ -5,6 +5,8 @@ | |||
5 | * Sean MacLennan <smaclennan@pikatech.com> | 5 | * Sean MacLennan <smaclennan@pikatech.com> |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
9 | |||
8 | #include <linux/init.h> | 10 | #include <linux/init.h> |
9 | #include <linux/errno.h> | 11 | #include <linux/errno.h> |
10 | #include <linux/module.h> | 12 | #include <linux/module.h> |
@@ -23,7 +25,6 @@ | |||
23 | #include <linux/of_platform.h> | 25 | #include <linux/of_platform.h> |
24 | 26 | ||
25 | #define DRV_NAME "PIKA-WDT" | 27 | #define DRV_NAME "PIKA-WDT" |
26 | #define PFX DRV_NAME ": " | ||
27 | 28 | ||
28 | /* Hardware timeout in seconds */ | 29 | /* Hardware timeout in seconds */ |
29 | #define WDT_HW_TIMEOUT 2 | 30 | #define WDT_HW_TIMEOUT 2 |
@@ -90,7 +91,7 @@ static void pikawdt_ping(unsigned long data) | |||
90 | pikawdt_reset(); | 91 | pikawdt_reset(); |
91 | mod_timer(&pikawdt_private.timer, jiffies + WDT_TIMEOUT); | 92 | mod_timer(&pikawdt_private.timer, jiffies + WDT_TIMEOUT); |
92 | } else | 93 | } else |
93 | printk(KERN_CRIT PFX "I will reset your machine !\n"); | 94 | pr_crit("I will reset your machine !\n"); |
94 | } | 95 | } |
95 | 96 | ||
96 | 97 | ||
@@ -228,14 +229,14 @@ static int __init pikawdt_init(void) | |||
228 | 229 | ||
229 | np = of_find_compatible_node(NULL, NULL, "pika,fpga"); | 230 | np = of_find_compatible_node(NULL, NULL, "pika,fpga"); |
230 | if (np == NULL) { | 231 | if (np == NULL) { |
231 | printk(KERN_ERR PFX "Unable to find fpga.\n"); | 232 | pr_err("Unable to find fpga\n"); |
232 | return -ENOENT; | 233 | return -ENOENT; |
233 | } | 234 | } |
234 | 235 | ||
235 | pikawdt_private.fpga = of_iomap(np, 0); | 236 | pikawdt_private.fpga = of_iomap(np, 0); |
236 | of_node_put(np); | 237 | of_node_put(np); |
237 | if (pikawdt_private.fpga == NULL) { | 238 | if (pikawdt_private.fpga == NULL) { |
238 | printk(KERN_ERR PFX "Unable to map fpga.\n"); | 239 | pr_err("Unable to map fpga\n"); |
239 | return -ENOMEM; | 240 | return -ENOMEM; |
240 | } | 241 | } |
241 | 242 | ||
@@ -244,7 +245,7 @@ static int __init pikawdt_init(void) | |||
244 | /* POST information is in the sd area. */ | 245 | /* POST information is in the sd area. */ |
245 | np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); | 246 | np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); |
246 | if (np == NULL) { | 247 | if (np == NULL) { |
247 | printk(KERN_ERR PFX "Unable to find fpga-sd.\n"); | 248 | pr_err("Unable to find fpga-sd\n"); |
248 | ret = -ENOENT; | 249 | ret = -ENOENT; |
249 | goto out; | 250 | goto out; |
250 | } | 251 | } |
@@ -252,7 +253,7 @@ static int __init pikawdt_init(void) | |||
252 | fpga = of_iomap(np, 0); | 253 | fpga = of_iomap(np, 0); |
253 | of_node_put(np); | 254 | of_node_put(np); |
254 | if (fpga == NULL) { | 255 | if (fpga == NULL) { |
255 | printk(KERN_ERR PFX "Unable to map fpga-sd.\n"); | 256 | pr_err("Unable to map fpga-sd\n"); |
256 | ret = -ENOMEM; | 257 | ret = -ENOMEM; |
257 | goto out; | 258 | goto out; |
258 | } | 259 | } |
@@ -271,12 +272,12 @@ static int __init pikawdt_init(void) | |||
271 | 272 | ||
272 | ret = misc_register(&pikawdt_miscdev); | 273 | ret = misc_register(&pikawdt_miscdev); |
273 | if (ret) { | 274 | if (ret) { |
274 | printk(KERN_ERR PFX "Unable to register miscdev.\n"); | 275 | pr_err("Unable to register miscdev\n"); |
275 | goto out; | 276 | goto out; |
276 | } | 277 | } |
277 | 278 | ||
278 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 279 | pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", |
279 | heartbeat, nowayout); | 280 | heartbeat, nowayout); |
280 | return 0; | 281 | return 0; |
281 | 282 | ||
282 | out: | 283 | out: |
diff --git a/drivers/watchdog/pnx4008_wdt.c b/drivers/watchdog/pnx4008_wdt.c index 1d1de919d615..ae927093cb6d 100644 --- a/drivers/watchdog/pnx4008_wdt.c +++ b/drivers/watchdog/pnx4008_wdt.c | |||
@@ -14,6 +14,8 @@ | |||
14 | * or implied. | 14 | * or implied. |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
18 | |||
17 | #include <linux/module.h> | 19 | #include <linux/module.h> |
18 | #include <linux/moduleparam.h> | 20 | #include <linux/moduleparam.h> |
19 | #include <linux/types.h> | 21 | #include <linux/types.h> |
@@ -222,7 +224,7 @@ static long pnx4008_wdt_ioctl(struct file *file, unsigned int cmd, | |||
222 | static int pnx4008_wdt_release(struct inode *inode, struct file *file) | 224 | static int pnx4008_wdt_release(struct inode *inode, struct file *file) |
223 | { | 225 | { |
224 | if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status)) | 226 | if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status)) |
225 | printk(KERN_WARNING "WATCHDOG: Device closed unexpectedly\n"); | 227 | pr_warn("Device closed unexpectedly\n"); |
226 | 228 | ||
227 | wdt_disable(); | 229 | wdt_disable(); |
228 | clk_disable(wdt_clk); | 230 | clk_disable(wdt_clk); |
diff --git a/drivers/watchdog/pnx833x_wdt.c b/drivers/watchdog/pnx833x_wdt.c index a7b5ad2a98bd..97959e9738e4 100644 --- a/drivers/watchdog/pnx833x_wdt.c +++ b/drivers/watchdog/pnx833x_wdt.c | |||
@@ -17,6 +17,8 @@ | |||
17 | * based on softdog.c by Alan Cox <alan@redhat.com> | 17 | * based on softdog.c by Alan Cox <alan@redhat.com> |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | #include <linux/module.h> | 22 | #include <linux/module.h> |
21 | #include <linux/moduleparam.h> | 23 | #include <linux/moduleparam.h> |
22 | #include <linux/types.h> | 24 | #include <linux/types.h> |
@@ -30,7 +32,6 @@ | |||
30 | #include <linux/init.h> | 32 | #include <linux/init.h> |
31 | #include <asm/mach-pnx833x/pnx833x.h> | 33 | #include <asm/mach-pnx833x/pnx833x.h> |
32 | 34 | ||
33 | #define PFX "pnx833x: " | ||
34 | #define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */ | 35 | #define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */ |
35 | #define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */ | 36 | #define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */ |
36 | #define PNX_WATCHDOG_TIMEOUT (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY) | 37 | #define PNX_WATCHDOG_TIMEOUT (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY) |
@@ -76,7 +77,7 @@ static void pnx833x_wdt_start(void) | |||
76 | PNX833X_REG(PNX833X_CONFIG + | 77 | PNX833X_REG(PNX833X_CONFIG + |
77 | PNX833X_CONFIG_CPU_COUNTERS_CONTROL) |= 0x1; | 78 | PNX833X_CONFIG_CPU_COUNTERS_CONTROL) |= 0x1; |
78 | 79 | ||
79 | printk(KERN_INFO PFX "Started watchdog timer.\n"); | 80 | pr_info("Started watchdog timer\n"); |
80 | } | 81 | } |
81 | 82 | ||
82 | static void pnx833x_wdt_stop(void) | 83 | static void pnx833x_wdt_stop(void) |
@@ -87,7 +88,7 @@ static void pnx833x_wdt_stop(void) | |||
87 | PNX833X_REG(PNX833X_CONFIG + | 88 | PNX833X_REG(PNX833X_CONFIG + |
88 | PNX833X_CONFIG_CPU_COUNTERS_CONTROL) &= 0xFFFFFFFE; | 89 | PNX833X_CONFIG_CPU_COUNTERS_CONTROL) &= 0xFFFFFFFE; |
89 | 90 | ||
90 | printk(KERN_INFO PFX "Stopped watchdog timer.\n"); | 91 | pr_info("Stopped watchdog timer\n"); |
91 | } | 92 | } |
92 | 93 | ||
93 | static void pnx833x_wdt_ping(void) | 94 | static void pnx833x_wdt_ping(void) |
@@ -113,7 +114,7 @@ static int pnx833x_wdt_open(struct inode *inode, struct file *file) | |||
113 | 114 | ||
114 | pnx833x_wdt_ping(); | 115 | pnx833x_wdt_ping(); |
115 | 116 | ||
116 | printk(KERN_INFO "Started watchdog timer.\n"); | 117 | pr_info("Started watchdog timer\n"); |
117 | 118 | ||
118 | return nonseekable_open(inode, file); | 119 | return nonseekable_open(inode, file); |
119 | } | 120 | } |
@@ -232,9 +233,6 @@ static struct notifier_block pnx833x_wdt_notifier = { | |||
232 | .notifier_call = pnx833x_wdt_notify_sys, | 233 | .notifier_call = pnx833x_wdt_notify_sys, |
233 | }; | 234 | }; |
234 | 235 | ||
235 | static char banner[] __initdata = | ||
236 | KERN_INFO PFX "Hardware Watchdog Timer for PNX833x: Version 0.1\n"; | ||
237 | |||
238 | static int __init watchdog_init(void) | 236 | static int __init watchdog_init(void) |
239 | { | 237 | { |
240 | int ret, cause; | 238 | int ret, cause; |
@@ -243,27 +241,25 @@ static int __init watchdog_init(void) | |||
243 | cause = PNX833X_REG(PNX833X_RESET); | 241 | cause = PNX833X_REG(PNX833X_RESET); |
244 | /*If bit 31 is set then watchdog was cause of reset.*/ | 242 | /*If bit 31 is set then watchdog was cause of reset.*/ |
245 | if (cause & 0x80000000) { | 243 | if (cause & 0x80000000) { |
246 | printk(KERN_INFO PFX "The system was previously reset due to " | 244 | pr_info("The system was previously reset due to the watchdog firing - please investigate...\n"); |
247 | "the watchdog firing - please investigate...\n"); | ||
248 | } | 245 | } |
249 | 246 | ||
250 | ret = register_reboot_notifier(&pnx833x_wdt_notifier); | 247 | ret = register_reboot_notifier(&pnx833x_wdt_notifier); |
251 | if (ret) { | 248 | if (ret) { |
252 | printk(KERN_ERR PFX | 249 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
253 | "cannot register reboot notifier (err=%d)\n", ret); | ||
254 | return ret; | 250 | return ret; |
255 | } | 251 | } |
256 | 252 | ||
257 | ret = misc_register(&pnx833x_wdt_miscdev); | 253 | ret = misc_register(&pnx833x_wdt_miscdev); |
258 | if (ret) { | 254 | if (ret) { |
259 | printk(KERN_ERR PFX | 255 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
260 | "cannot register miscdev on minor=%d (err=%d)\n", | 256 | WATCHDOG_MINOR, ret); |
261 | WATCHDOG_MINOR, ret); | ||
262 | unregister_reboot_notifier(&pnx833x_wdt_notifier); | 257 | unregister_reboot_notifier(&pnx833x_wdt_notifier); |
263 | return ret; | 258 | return ret; |
264 | } | 259 | } |
265 | 260 | ||
266 | printk(banner); | 261 | pr_info("Hardware Watchdog Timer for PNX833x: Version 0.1\n"); |
262 | |||
267 | if (start_enabled) | 263 | if (start_enabled) |
268 | pnx833x_wdt_start(); | 264 | pnx833x_wdt_start(); |
269 | 265 | ||
diff --git a/drivers/watchdog/rc32434_wdt.c b/drivers/watchdog/rc32434_wdt.c index bf7bc8aa1c01..76c9d1cf8cf1 100644 --- a/drivers/watchdog/rc32434_wdt.c +++ b/drivers/watchdog/rc32434_wdt.c | |||
@@ -17,6 +17,8 @@ | |||
17 | * | 17 | * |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | #include <linux/module.h> /* For module specific items */ | 22 | #include <linux/module.h> /* For module specific items */ |
21 | #include <linux/moduleparam.h> /* For new moduleparam's */ | 23 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
22 | #include <linux/types.h> /* For standard types (like size_t) */ | 24 | #include <linux/types.h> /* For standard types (like size_t) */ |
@@ -33,8 +35,6 @@ | |||
33 | 35 | ||
34 | #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ | 36 | #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ |
35 | 37 | ||
36 | #define PFX KBUILD_MODNAME ": " | ||
37 | |||
38 | #define VERSION "1.0" | 38 | #define VERSION "1.0" |
39 | 39 | ||
40 | static struct { | 40 | static struct { |
@@ -78,8 +78,7 @@ static int rc32434_wdt_set(int new_timeout) | |||
78 | int max_to = WTCOMP2SEC((u32)-1); | 78 | int max_to = WTCOMP2SEC((u32)-1); |
79 | 79 | ||
80 | if (new_timeout < 0 || new_timeout > max_to) { | 80 | if (new_timeout < 0 || new_timeout > max_to) { |
81 | printk(KERN_ERR PFX "timeout value must be between 0 and %d", | 81 | pr_err("timeout value must be between 0 and %d\n", max_to); |
82 | max_to); | ||
83 | return -EINVAL; | 82 | return -EINVAL; |
84 | } | 83 | } |
85 | timeout = new_timeout; | 84 | timeout = new_timeout; |
@@ -119,7 +118,7 @@ static void rc32434_wdt_start(void) | |||
119 | SET_BITS(wdt_reg->wtc, or, nand); | 118 | SET_BITS(wdt_reg->wtc, or, nand); |
120 | 119 | ||
121 | spin_unlock(&rc32434_wdt_device.io_lock); | 120 | spin_unlock(&rc32434_wdt_device.io_lock); |
122 | printk(KERN_INFO PFX "Started watchdog timer.\n"); | 121 | pr_info("Started watchdog timer\n"); |
123 | } | 122 | } |
124 | 123 | ||
125 | static void rc32434_wdt_stop(void) | 124 | static void rc32434_wdt_stop(void) |
@@ -130,7 +129,7 @@ static void rc32434_wdt_stop(void) | |||
130 | SET_BITS(wdt_reg->wtc, 0, 1 << RC32434_WTC_EN); | 129 | SET_BITS(wdt_reg->wtc, 0, 1 << RC32434_WTC_EN); |
131 | 130 | ||
132 | spin_unlock(&rc32434_wdt_device.io_lock); | 131 | spin_unlock(&rc32434_wdt_device.io_lock); |
133 | printk(KERN_INFO PFX "Stopped watchdog timer.\n"); | 132 | pr_info("Stopped watchdog timer\n"); |
134 | } | 133 | } |
135 | 134 | ||
136 | static void rc32434_wdt_ping(void) | 135 | static void rc32434_wdt_ping(void) |
@@ -160,8 +159,7 @@ static int rc32434_wdt_release(struct inode *inode, struct file *file) | |||
160 | rc32434_wdt_stop(); | 159 | rc32434_wdt_stop(); |
161 | module_put(THIS_MODULE); | 160 | module_put(THIS_MODULE); |
162 | } else { | 161 | } else { |
163 | printk(KERN_CRIT PFX | 162 | pr_crit("device closed unexpectedly. WDT will not stop!\n"); |
164 | "device closed unexpectedly. WDT will not stop!\n"); | ||
165 | rc32434_wdt_ping(); | 163 | rc32434_wdt_ping(); |
166 | } | 164 | } |
167 | clear_bit(0, &rc32434_wdt_device.inuse); | 165 | clear_bit(0, &rc32434_wdt_device.inuse); |
@@ -262,9 +260,6 @@ static struct miscdevice rc32434_wdt_miscdev = { | |||
262 | .fops = &rc32434_wdt_fops, | 260 | .fops = &rc32434_wdt_fops, |
263 | }; | 261 | }; |
264 | 262 | ||
265 | static char banner[] __devinitdata = KERN_INFO PFX | ||
266 | "Watchdog Timer version " VERSION ", timer margin: %d sec\n"; | ||
267 | |||
268 | static int __devinit rc32434_wdt_probe(struct platform_device *pdev) | 263 | static int __devinit rc32434_wdt_probe(struct platform_device *pdev) |
269 | { | 264 | { |
270 | int ret; | 265 | int ret; |
@@ -272,13 +267,13 @@ static int __devinit rc32434_wdt_probe(struct platform_device *pdev) | |||
272 | 267 | ||
273 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rb532_wdt_res"); | 268 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rb532_wdt_res"); |
274 | if (!r) { | 269 | if (!r) { |
275 | printk(KERN_ERR PFX "failed to retrieve resources\n"); | 270 | pr_err("failed to retrieve resources\n"); |
276 | return -ENODEV; | 271 | return -ENODEV; |
277 | } | 272 | } |
278 | 273 | ||
279 | wdt_reg = ioremap_nocache(r->start, resource_size(r)); | 274 | wdt_reg = ioremap_nocache(r->start, resource_size(r)); |
280 | if (!wdt_reg) { | 275 | if (!wdt_reg) { |
281 | printk(KERN_ERR PFX "failed to remap I/O resources\n"); | 276 | pr_err("failed to remap I/O resources\n"); |
282 | return -ENXIO; | 277 | return -ENXIO; |
283 | } | 278 | } |
284 | 279 | ||
@@ -291,18 +286,18 @@ static int __devinit rc32434_wdt_probe(struct platform_device *pdev) | |||
291 | * if not reset to the default */ | 286 | * if not reset to the default */ |
292 | if (rc32434_wdt_set(timeout)) { | 287 | if (rc32434_wdt_set(timeout)) { |
293 | rc32434_wdt_set(WATCHDOG_TIMEOUT); | 288 | rc32434_wdt_set(WATCHDOG_TIMEOUT); |
294 | printk(KERN_INFO PFX | 289 | pr_info("timeout value must be between 0 and %d\n", |
295 | "timeout value must be between 0 and %d\n", | ||
296 | WTCOMP2SEC((u32)-1)); | 290 | WTCOMP2SEC((u32)-1)); |
297 | } | 291 | } |
298 | 292 | ||
299 | ret = misc_register(&rc32434_wdt_miscdev); | 293 | ret = misc_register(&rc32434_wdt_miscdev); |
300 | if (ret < 0) { | 294 | if (ret < 0) { |
301 | printk(KERN_ERR PFX "failed to register watchdog device\n"); | 295 | pr_err("failed to register watchdog device\n"); |
302 | goto unmap; | 296 | goto unmap; |
303 | } | 297 | } |
304 | 298 | ||
305 | printk(banner, timeout); | 299 | pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n", |
300 | timeout); | ||
306 | 301 | ||
307 | return 0; | 302 | return 0; |
308 | 303 | ||
diff --git a/drivers/watchdog/riowd.c b/drivers/watchdog/riowd.c index c7e17ceafa6a..49e1b1c2135c 100644 --- a/drivers/watchdog/riowd.c +++ b/drivers/watchdog/riowd.c | |||
@@ -3,6 +3,8 @@ | |||
3 | * Copyright (C) 2001, 2008 David S. Miller (davem@davemloft.net) | 3 | * Copyright (C) 2001, 2008 David S. Miller (davem@davemloft.net) |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
7 | |||
6 | #include <linux/kernel.h> | 8 | #include <linux/kernel.h> |
7 | #include <linux/module.h> | 9 | #include <linux/module.h> |
8 | #include <linux/types.h> | 10 | #include <linux/types.h> |
@@ -189,7 +191,7 @@ static int __devinit riowd_probe(struct platform_device *op) | |||
189 | 191 | ||
190 | p->regs = of_ioremap(&op->resource[0], 0, 2, DRIVER_NAME); | 192 | p->regs = of_ioremap(&op->resource[0], 0, 2, DRIVER_NAME); |
191 | if (!p->regs) { | 193 | if (!p->regs) { |
192 | printk(KERN_ERR PFX "Cannot map registers.\n"); | 194 | pr_err("Cannot map registers\n"); |
193 | goto out_free; | 195 | goto out_free; |
194 | } | 196 | } |
195 | /* Make miscdev useable right away */ | 197 | /* Make miscdev useable right away */ |
@@ -197,12 +199,12 @@ static int __devinit riowd_probe(struct platform_device *op) | |||
197 | 199 | ||
198 | err = misc_register(&riowd_miscdev); | 200 | err = misc_register(&riowd_miscdev); |
199 | if (err) { | 201 | if (err) { |
200 | printk(KERN_ERR PFX "Cannot register watchdog misc device.\n"); | 202 | pr_err("Cannot register watchdog misc device\n"); |
201 | goto out_iounmap; | 203 | goto out_iounmap; |
202 | } | 204 | } |
203 | 205 | ||
204 | printk(KERN_INFO PFX "Hardware watchdog [%i minutes], " | 206 | pr_info("Hardware watchdog [%i minutes], regs at %p\n", |
205 | "regs at %p\n", riowd_timeout, p->regs); | 207 | riowd_timeout, p->regs); |
206 | 208 | ||
207 | dev_set_drvdata(&op->dev, p); | 209 | dev_set_drvdata(&op->dev, p); |
208 | return 0; | 210 | return 0; |
diff --git a/drivers/watchdog/s3c2410_wdt.c b/drivers/watchdog/s3c2410_wdt.c index 404172f02c9b..ce18029011f7 100644 --- a/drivers/watchdog/s3c2410_wdt.c +++ b/drivers/watchdog/s3c2410_wdt.c | |||
@@ -23,6 +23,8 @@ | |||
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
27 | |||
26 | #include <linux/module.h> | 28 | #include <linux/module.h> |
27 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
28 | #include <linux/types.h> | 30 | #include <linux/types.h> |
@@ -46,8 +48,6 @@ | |||
46 | 48 | ||
47 | #include <plat/regs-watchdog.h> | 49 | #include <plat/regs-watchdog.h> |
48 | 50 | ||
49 | #define PFX "s3c2410-wdt: " | ||
50 | |||
51 | #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) | 51 | #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) |
52 | #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) | 52 | #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) |
53 | 53 | ||
@@ -84,10 +84,11 @@ static DEFINE_SPINLOCK(wdt_lock); | |||
84 | 84 | ||
85 | /* watchdog control routines */ | 85 | /* watchdog control routines */ |
86 | 86 | ||
87 | #define DBG(msg...) do { \ | 87 | #define DBG(fmt, ...) \ |
88 | if (debug) \ | 88 | do { \ |
89 | printk(KERN_INFO msg); \ | 89 | if (debug) \ |
90 | } while (0) | 90 | pr_info(fmt, ##__VA_ARGS__); \ |
91 | } while (0) | ||
91 | 92 | ||
92 | /* functions */ | 93 | /* functions */ |
93 | 94 | ||
@@ -354,7 +355,7 @@ static int __devinit s3c2410wdt_probe(struct platform_device *pdev) | |||
354 | 355 | ||
355 | ret = s3c2410wdt_cpufreq_register(); | 356 | ret = s3c2410wdt_cpufreq_register(); |
356 | if (ret < 0) { | 357 | if (ret < 0) { |
357 | printk(KERN_ERR PFX "failed to register cpufreq\n"); | 358 | pr_err("failed to register cpufreq\n"); |
358 | goto err_clk; | 359 | goto err_clk; |
359 | } | 360 | } |
360 | 361 | ||
@@ -483,8 +484,8 @@ static int s3c2410wdt_resume(struct platform_device *dev) | |||
483 | writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */ | 484 | writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */ |
484 | writel(wtcon_save, wdt_base + S3C2410_WTCON); | 485 | writel(wtcon_save, wdt_base + S3C2410_WTCON); |
485 | 486 | ||
486 | printk(KERN_INFO PFX "watchdog %sabled\n", | 487 | pr_info("watchdog %sabled\n", |
487 | (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); | 488 | (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); |
488 | 489 | ||
489 | return 0; | 490 | return 0; |
490 | } | 491 | } |
@@ -518,12 +519,10 @@ static struct platform_driver s3c2410wdt_driver = { | |||
518 | }; | 519 | }; |
519 | 520 | ||
520 | 521 | ||
521 | static char banner[] __initdata = | ||
522 | KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; | ||
523 | |||
524 | static int __init watchdog_init(void) | 522 | static int __init watchdog_init(void) |
525 | { | 523 | { |
526 | printk(banner); | 524 | pr_info("S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; |
525 | |||
527 | return platform_driver_register(&s3c2410wdt_driver); | 526 | return platform_driver_register(&s3c2410wdt_driver); |
528 | } | 527 | } |
529 | 528 | ||
diff --git a/drivers/watchdog/sa1100_wdt.c b/drivers/watchdog/sa1100_wdt.c index 016245419fad..d54e04df45e4 100644 --- a/drivers/watchdog/sa1100_wdt.c +++ b/drivers/watchdog/sa1100_wdt.c | |||
@@ -17,6 +17,9 @@ | |||
17 | * | 17 | * |
18 | * 27/11/2000 Initial release | 18 | * 27/11/2000 Initial release |
19 | */ | 19 | */ |
20 | |||
21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
22 | |||
20 | #include <linux/module.h> | 23 | #include <linux/module.h> |
21 | #include <linux/moduleparam.h> | 24 | #include <linux/moduleparam.h> |
22 | #include <linux/types.h> | 25 | #include <linux/types.h> |
@@ -66,7 +69,7 @@ static int sa1100dog_open(struct inode *inode, struct file *file) | |||
66 | */ | 69 | */ |
67 | static int sa1100dog_release(struct inode *inode, struct file *file) | 70 | static int sa1100dog_release(struct inode *inode, struct file *file) |
68 | { | 71 | { |
69 | printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n"); | 72 | pr_crit("Device closed - timer will not stop\n"); |
70 | clear_bit(1, &sa1100wdt_users); | 73 | clear_bit(1, &sa1100wdt_users); |
71 | return 0; | 74 | return 0; |
72 | } | 75 | } |
@@ -169,9 +172,8 @@ static int __init sa1100dog_init(void) | |||
169 | 172 | ||
170 | ret = misc_register(&sa1100dog_miscdev); | 173 | ret = misc_register(&sa1100dog_miscdev); |
171 | if (ret == 0) | 174 | if (ret == 0) |
172 | printk(KERN_INFO | 175 | pr_info("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", |
173 | "SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", | 176 | margin); |
174 | margin); | ||
175 | return ret; | 177 | return ret; |
176 | } | 178 | } |
177 | 179 | ||
diff --git a/drivers/watchdog/sb_wdog.c b/drivers/watchdog/sb_wdog.c index b01a30e5a663..25c7a3f9652d 100644 --- a/drivers/watchdog/sb_wdog.c +++ b/drivers/watchdog/sb_wdog.c | |||
@@ -43,6 +43,9 @@ | |||
43 | * version 1 or 2 as published by the Free Software Foundation. | 43 | * version 1 or 2 as published by the Free Software Foundation. |
44 | * | 44 | * |
45 | */ | 45 | */ |
46 | |||
47 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
48 | |||
46 | #include <linux/module.h> | 49 | #include <linux/module.h> |
47 | #include <linux/io.h> | 50 | #include <linux/io.h> |
48 | #include <linux/uaccess.h> | 51 | #include <linux/uaccess.h> |
@@ -125,9 +128,8 @@ static int sbwdog_release(struct inode *inode, struct file *file) | |||
125 | __raw_writeb(0, user_dog); | 128 | __raw_writeb(0, user_dog); |
126 | module_put(THIS_MODULE); | 129 | module_put(THIS_MODULE); |
127 | } else { | 130 | } else { |
128 | printk(KERN_CRIT | 131 | pr_crit("%s: Unexpected close, not stopping watchdog!\n", |
129 | "%s: Unexpected close, not stopping watchdog!\n", | 132 | ident.identity); |
130 | ident.identity); | ||
131 | sbwdog_pet(user_dog); | 133 | sbwdog_pet(user_dog); |
132 | } | 134 | } |
133 | clear_bit(0, &sbwdog_gate); | 135 | clear_bit(0, &sbwdog_gate); |
@@ -269,7 +271,7 @@ irqreturn_t sbwdog_interrupt(int irq, void *addr) | |||
269 | * if it's the second watchdog timer, it's for those users | 271 | * if it's the second watchdog timer, it's for those users |
270 | */ | 272 | */ |
271 | if (wd_cfg_reg == user_dog) | 273 | if (wd_cfg_reg == user_dog) |
272 | printk(KERN_CRIT "%s in danger of initiating system reset " | 274 | pr_crit("%s in danger of initiating system reset " |
273 | "in %ld.%01ld seconds\n", | 275 | "in %ld.%01ld seconds\n", |
274 | ident.identity, | 276 | ident.identity, |
275 | wd_init / 1000000, (wd_init / 100000) % 10); | 277 | wd_init / 1000000, (wd_init / 100000) % 10); |
@@ -290,9 +292,8 @@ static int __init sbwdog_init(void) | |||
290 | */ | 292 | */ |
291 | ret = register_reboot_notifier(&sbwdog_notifier); | 293 | ret = register_reboot_notifier(&sbwdog_notifier); |
292 | if (ret) { | 294 | if (ret) { |
293 | printk(KERN_ERR | 295 | pr_err("%s: cannot register reboot notifier (err=%d)\n", |
294 | "%s: cannot register reboot notifier (err=%d)\n", | 296 | ident.identity, ret); |
295 | ident.identity, ret); | ||
296 | return ret; | 297 | return ret; |
297 | } | 298 | } |
298 | 299 | ||
@@ -303,16 +304,16 @@ static int __init sbwdog_init(void) | |||
303 | ret = request_irq(1, sbwdog_interrupt, IRQF_SHARED, | 304 | ret = request_irq(1, sbwdog_interrupt, IRQF_SHARED, |
304 | ident.identity, (void *)user_dog); | 305 | ident.identity, (void *)user_dog); |
305 | if (ret) { | 306 | if (ret) { |
306 | printk(KERN_ERR "%s: failed to request irq 1 - %d\n", | 307 | pr_err("%s: failed to request irq 1 - %d\n", |
307 | ident.identity, ret); | 308 | ident.identity, ret); |
308 | goto out; | 309 | goto out; |
309 | } | 310 | } |
310 | 311 | ||
311 | ret = misc_register(&sbwdog_miscdev); | 312 | ret = misc_register(&sbwdog_miscdev); |
312 | if (ret == 0) { | 313 | if (ret == 0) { |
313 | printk(KERN_INFO "%s: timeout is %ld.%ld secs\n", | 314 | pr_info("%s: timeout is %ld.%ld secs\n", |
314 | ident.identity, | 315 | ident.identity, |
315 | timeout / 1000000, (timeout / 100000) % 10); | 316 | timeout / 1000000, (timeout / 100000) % 10); |
316 | return 0; | 317 | return 0; |
317 | } | 318 | } |
318 | free_irq(1, (void *)user_dog); | 319 | free_irq(1, (void *)user_dog); |
@@ -353,8 +354,7 @@ void platform_wd_setup(void) | |||
353 | ret = request_irq(1, sbwdog_interrupt, IRQF_SHARED, | 354 | ret = request_irq(1, sbwdog_interrupt, IRQF_SHARED, |
354 | "Kernel Watchdog", IOADDR(A_SCD_WDOG_CFG_0)); | 355 | "Kernel Watchdog", IOADDR(A_SCD_WDOG_CFG_0)); |
355 | if (ret) { | 356 | if (ret) { |
356 | printk(KERN_CRIT | 357 | pr_crit("Watchdog IRQ zero(0) failed to be requested - %d\n", ret); |
357 | "Watchdog IRQ zero(0) failed to be requested - %d\n", ret); | ||
358 | } | 358 | } |
359 | } | 359 | } |
360 | 360 | ||
diff --git a/drivers/watchdog/sbc60xxwdt.c b/drivers/watchdog/sbc60xxwdt.c index 626d0e8e56c3..1d0c971d8857 100644 --- a/drivers/watchdog/sbc60xxwdt.c +++ b/drivers/watchdog/sbc60xxwdt.c | |||
@@ -48,6 +48,8 @@ | |||
48 | * | 48 | * |
49 | */ | 49 | */ |
50 | 50 | ||
51 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
52 | |||
51 | #include <linux/module.h> | 53 | #include <linux/module.h> |
52 | #include <linux/moduleparam.h> | 54 | #include <linux/moduleparam.h> |
53 | #include <linux/types.h> | 55 | #include <linux/types.h> |
@@ -132,8 +134,7 @@ static void wdt_timer_ping(unsigned long data) | |||
132 | /* Re-set the timer interval */ | 134 | /* Re-set the timer interval */ |
133 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 135 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
134 | } else | 136 | } else |
135 | printk(KERN_WARNING PFX | 137 | pr_warn("Heartbeat lost! Will not ping the watchdog\n"); |
136 | "Heartbeat lost! Will not ping the watchdog\n"); | ||
137 | } | 138 | } |
138 | 139 | ||
139 | /* | 140 | /* |
@@ -146,7 +147,7 @@ static void wdt_startup(void) | |||
146 | 147 | ||
147 | /* Start the timer */ | 148 | /* Start the timer */ |
148 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 149 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
149 | printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); | 150 | pr_info("Watchdog timer is now enabled\n"); |
150 | } | 151 | } |
151 | 152 | ||
152 | static void wdt_turnoff(void) | 153 | static void wdt_turnoff(void) |
@@ -154,7 +155,7 @@ static void wdt_turnoff(void) | |||
154 | /* Stop the timer */ | 155 | /* Stop the timer */ |
155 | del_timer(&timer); | 156 | del_timer(&timer); |
156 | inb_p(wdt_stop); | 157 | inb_p(wdt_stop); |
157 | printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); | 158 | pr_info("Watchdog timer is now disabled...\n"); |
158 | } | 159 | } |
159 | 160 | ||
160 | static void wdt_keepalive(void) | 161 | static void wdt_keepalive(void) |
@@ -217,8 +218,7 @@ static int fop_close(struct inode *inode, struct file *file) | |||
217 | wdt_turnoff(); | 218 | wdt_turnoff(); |
218 | else { | 219 | else { |
219 | del_timer(&timer); | 220 | del_timer(&timer); |
220 | printk(KERN_CRIT PFX | 221 | pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); |
221 | "device file closed unexpectedly. Will not stop the WDT!\n"); | ||
222 | } | 222 | } |
223 | clear_bit(0, &wdt_is_open); | 223 | clear_bit(0, &wdt_is_open); |
224 | wdt_expect_close = 0; | 224 | wdt_expect_close = 0; |
@@ -335,14 +335,12 @@ static int __init sbc60xxwdt_init(void) | |||
335 | 335 | ||
336 | if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ | 336 | if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ |
337 | timeout = WATCHDOG_TIMEOUT; | 337 | timeout = WATCHDOG_TIMEOUT; |
338 | printk(KERN_INFO PFX | 338 | pr_info("timeout value must be 1 <= x <= 3600, using %d\n", |
339 | "timeout value must be 1 <= x <= 3600, using %d\n", | 339 | timeout); |
340 | timeout); | ||
341 | } | 340 | } |
342 | 341 | ||
343 | if (!request_region(wdt_start, 1, "SBC 60XX WDT")) { | 342 | if (!request_region(wdt_start, 1, "SBC 60XX WDT")) { |
344 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 343 | pr_err("I/O address 0x%04x already in use\n", wdt_start); |
345 | wdt_start); | ||
346 | rc = -EIO; | 344 | rc = -EIO; |
347 | goto err_out; | 345 | goto err_out; |
348 | } | 346 | } |
@@ -350,9 +348,7 @@ static int __init sbc60xxwdt_init(void) | |||
350 | /* We cannot reserve 0x45 - the kernel already has! */ | 348 | /* We cannot reserve 0x45 - the kernel already has! */ |
351 | if (wdt_stop != 0x45 && wdt_stop != wdt_start) { | 349 | if (wdt_stop != 0x45 && wdt_stop != wdt_start) { |
352 | if (!request_region(wdt_stop, 1, "SBC 60XX WDT")) { | 350 | if (!request_region(wdt_stop, 1, "SBC 60XX WDT")) { |
353 | printk(KERN_ERR PFX | 351 | pr_err("I/O address 0x%04x already in use\n", wdt_stop); |
354 | "I/O address 0x%04x already in use\n", | ||
355 | wdt_stop); | ||
356 | rc = -EIO; | 352 | rc = -EIO; |
357 | goto err_out_region1; | 353 | goto err_out_region1; |
358 | } | 354 | } |
@@ -360,21 +356,18 @@ static int __init sbc60xxwdt_init(void) | |||
360 | 356 | ||
361 | rc = register_reboot_notifier(&wdt_notifier); | 357 | rc = register_reboot_notifier(&wdt_notifier); |
362 | if (rc) { | 358 | if (rc) { |
363 | printk(KERN_ERR PFX | 359 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
364 | "cannot register reboot notifier (err=%d)\n", rc); | ||
365 | goto err_out_region2; | 360 | goto err_out_region2; |
366 | } | 361 | } |
367 | 362 | ||
368 | rc = misc_register(&wdt_miscdev); | 363 | rc = misc_register(&wdt_miscdev); |
369 | if (rc) { | 364 | if (rc) { |
370 | printk(KERN_ERR PFX | 365 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
371 | "cannot register miscdev on minor=%d (err=%d)\n", | 366 | wdt_miscdev.minor, rc); |
372 | wdt_miscdev.minor, rc); | ||
373 | goto err_out_reboot; | 367 | goto err_out_reboot; |
374 | } | 368 | } |
375 | printk(KERN_INFO PFX | 369 | pr_info("WDT driver for 60XX single board computer initialised. timeout=%d sec (nowayout=%d)\n", |
376 | "WDT driver for 60XX single board computer initialised. " | 370 | timeout, nowayout); |
377 | "timeout=%d sec (nowayout=%d)\n", timeout, nowayout); | ||
378 | 371 | ||
379 | return 0; | 372 | return 0; |
380 | 373 | ||
diff --git a/drivers/watchdog/sbc7240_wdt.c b/drivers/watchdog/sbc7240_wdt.c index 93ac58953122..77cb302754db 100644 --- a/drivers/watchdog/sbc7240_wdt.c +++ b/drivers/watchdog/sbc7240_wdt.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * | 16 | * |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
20 | |||
19 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
20 | #include <linux/init.h> | 22 | #include <linux/init.h> |
21 | #include <linux/ioport.h> | 23 | #include <linux/ioport.h> |
@@ -32,8 +34,6 @@ | |||
32 | #include <linux/atomic.h> | 34 | #include <linux/atomic.h> |
33 | #include <asm/system.h> | 35 | #include <asm/system.h> |
34 | 36 | ||
35 | #define SBC7240_PREFIX "sbc7240_wdt: " | ||
36 | |||
37 | #define SBC7240_ENABLE_PORT 0x443 | 37 | #define SBC7240_ENABLE_PORT 0x443 |
38 | #define SBC7240_DISABLE_PORT 0x043 | 38 | #define SBC7240_DISABLE_PORT 0x043 |
39 | #define SBC7240_SET_TIMEOUT_PORT SBC7240_ENABLE_PORT | 39 | #define SBC7240_SET_TIMEOUT_PORT SBC7240_ENABLE_PORT |
@@ -65,8 +65,7 @@ static void wdt_disable(void) | |||
65 | /* disable the watchdog */ | 65 | /* disable the watchdog */ |
66 | if (test_and_clear_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { | 66 | if (test_and_clear_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { |
67 | inb_p(SBC7240_DISABLE_PORT); | 67 | inb_p(SBC7240_DISABLE_PORT); |
68 | printk(KERN_INFO SBC7240_PREFIX | 68 | pr_info("Watchdog timer is now disabled\n"); |
69 | "Watchdog timer is now disabled.\n"); | ||
70 | } | 69 | } |
71 | } | 70 | } |
72 | 71 | ||
@@ -75,23 +74,20 @@ static void wdt_enable(void) | |||
75 | /* enable the watchdog */ | 74 | /* enable the watchdog */ |
76 | if (!test_and_set_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { | 75 | if (!test_and_set_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { |
77 | inb_p(SBC7240_ENABLE_PORT); | 76 | inb_p(SBC7240_ENABLE_PORT); |
78 | printk(KERN_INFO SBC7240_PREFIX | 77 | pr_info("Watchdog timer is now enabled\n"); |
79 | "Watchdog timer is now enabled.\n"); | ||
80 | } | 78 | } |
81 | } | 79 | } |
82 | 80 | ||
83 | static int wdt_set_timeout(int t) | 81 | static int wdt_set_timeout(int t) |
84 | { | 82 | { |
85 | if (t < 1 || t > SBC7240_MAX_TIMEOUT) { | 83 | if (t < 1 || t > SBC7240_MAX_TIMEOUT) { |
86 | printk(KERN_ERR SBC7240_PREFIX | 84 | pr_err("timeout value must be 1<=x<=%d\n", SBC7240_MAX_TIMEOUT); |
87 | "timeout value must be 1<=x<=%d\n", | ||
88 | SBC7240_MAX_TIMEOUT); | ||
89 | return -1; | 85 | return -1; |
90 | } | 86 | } |
91 | /* set the timeout */ | 87 | /* set the timeout */ |
92 | outb_p((unsigned)t, SBC7240_SET_TIMEOUT_PORT); | 88 | outb_p((unsigned)t, SBC7240_SET_TIMEOUT_PORT); |
93 | timeout = t; | 89 | timeout = t; |
94 | printk(KERN_INFO SBC7240_PREFIX "timeout set to %d seconds\n", t); | 90 | pr_info("timeout set to %d seconds\n", t); |
95 | return 0; | 91 | return 0; |
96 | } | 92 | } |
97 | 93 | ||
@@ -150,8 +146,7 @@ static int fop_close(struct inode *inode, struct file *file) | |||
150 | || !nowayout) { | 146 | || !nowayout) { |
151 | wdt_disable(); | 147 | wdt_disable(); |
152 | } else { | 148 | } else { |
153 | printk(KERN_CRIT SBC7240_PREFIX | 149 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
154 | "Unexpected close, not stopping watchdog!\n"); | ||
155 | wdt_keepalive(); | 150 | wdt_keepalive(); |
156 | } | 151 | } |
157 | 152 | ||
@@ -252,7 +247,7 @@ static struct notifier_block wdt_notifier = { | |||
252 | 247 | ||
253 | static void __exit sbc7240_wdt_unload(void) | 248 | static void __exit sbc7240_wdt_unload(void) |
254 | { | 249 | { |
255 | printk(KERN_INFO SBC7240_PREFIX "Removing watchdog\n"); | 250 | pr_info("Removing watchdog\n"); |
256 | misc_deregister(&wdt_miscdev); | 251 | misc_deregister(&wdt_miscdev); |
257 | 252 | ||
258 | unregister_reboot_notifier(&wdt_notifier); | 253 | unregister_reboot_notifier(&wdt_notifier); |
@@ -264,8 +259,7 @@ static int __init sbc7240_wdt_init(void) | |||
264 | int rc = -EBUSY; | 259 | int rc = -EBUSY; |
265 | 260 | ||
266 | if (!request_region(SBC7240_ENABLE_PORT, 1, "SBC7240 WDT")) { | 261 | if (!request_region(SBC7240_ENABLE_PORT, 1, "SBC7240 WDT")) { |
267 | printk(KERN_ERR SBC7240_PREFIX | 262 | pr_err("I/O address 0x%04x already in use\n", |
268 | "I/O address 0x%04x already in use\n", | ||
269 | SBC7240_ENABLE_PORT); | 263 | SBC7240_ENABLE_PORT); |
270 | rc = -EIO; | 264 | rc = -EIO; |
271 | goto err_out; | 265 | goto err_out; |
@@ -277,31 +271,27 @@ static int __init sbc7240_wdt_init(void) | |||
277 | 271 | ||
278 | if (timeout < 1 || timeout > SBC7240_MAX_TIMEOUT) { | 272 | if (timeout < 1 || timeout > SBC7240_MAX_TIMEOUT) { |
279 | timeout = SBC7240_TIMEOUT; | 273 | timeout = SBC7240_TIMEOUT; |
280 | printk(KERN_INFO SBC7240_PREFIX | 274 | pr_info("timeout value must be 1<=x<=%d, using %d\n", |
281 | "timeout value must be 1<=x<=%d, using %d\n", | 275 | SBC7240_MAX_TIMEOUT, timeout); |
282 | SBC7240_MAX_TIMEOUT, timeout); | ||
283 | } | 276 | } |
284 | wdt_set_timeout(timeout); | 277 | wdt_set_timeout(timeout); |
285 | wdt_disable(); | 278 | wdt_disable(); |
286 | 279 | ||
287 | rc = register_reboot_notifier(&wdt_notifier); | 280 | rc = register_reboot_notifier(&wdt_notifier); |
288 | if (rc) { | 281 | if (rc) { |
289 | printk(KERN_ERR SBC7240_PREFIX | 282 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
290 | "cannot register reboot notifier (err=%d)\n", rc); | ||
291 | goto err_out_region; | 283 | goto err_out_region; |
292 | } | 284 | } |
293 | 285 | ||
294 | rc = misc_register(&wdt_miscdev); | 286 | rc = misc_register(&wdt_miscdev); |
295 | if (rc) { | 287 | if (rc) { |
296 | printk(KERN_ERR SBC7240_PREFIX | 288 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
297 | "cannot register miscdev on minor=%d (err=%d)\n", | ||
298 | wdt_miscdev.minor, rc); | 289 | wdt_miscdev.minor, rc); |
299 | goto err_out_reboot_notifier; | 290 | goto err_out_reboot_notifier; |
300 | } | 291 | } |
301 | 292 | ||
302 | printk(KERN_INFO SBC7240_PREFIX | 293 | pr_info("Watchdog driver for SBC7240 initialised (nowayout=%d)\n", |
303 | "Watchdog driver for SBC7240 initialised (nowayout=%d)\n", | 294 | nowayout); |
304 | nowayout); | ||
305 | 295 | ||
306 | return 0; | 296 | return 0; |
307 | 297 | ||
diff --git a/drivers/watchdog/sbc8360.c b/drivers/watchdog/sbc8360.c index 514ec23050f7..f72b6e013a93 100644 --- a/drivers/watchdog/sbc8360.c +++ b/drivers/watchdog/sbc8360.c | |||
@@ -36,6 +36,8 @@ | |||
36 | * | 36 | * |
37 | */ | 37 | */ |
38 | 38 | ||
39 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
40 | |||
39 | #include <linux/module.h> | 41 | #include <linux/module.h> |
40 | #include <linux/types.h> | 42 | #include <linux/types.h> |
41 | #include <linux/miscdevice.h> | 43 | #include <linux/miscdevice.h> |
@@ -56,8 +58,6 @@ | |||
56 | static unsigned long sbc8360_is_open; | 58 | static unsigned long sbc8360_is_open; |
57 | static char expect_close; | 59 | static char expect_close; |
58 | 60 | ||
59 | #define PFX "sbc8360: " | ||
60 | |||
61 | /* | 61 | /* |
62 | * | 62 | * |
63 | * Watchdog Timer Configuration | 63 | * Watchdog Timer Configuration |
@@ -280,8 +280,7 @@ static int sbc8360_close(struct inode *inode, struct file *file) | |||
280 | if (expect_close == 42) | 280 | if (expect_close == 42) |
281 | sbc8360_stop(); | 281 | sbc8360_stop(); |
282 | else | 282 | else |
283 | printk(KERN_CRIT PFX "SBC8360 device closed unexpectedly. " | 283 | pr_crit("SBC8360 device closed unexpectedly. SBC8360 will not stop!\n"); |
284 | "SBC8360 will not stop!\n"); | ||
285 | 284 | ||
286 | clear_bit(0, &sbc8360_is_open); | 285 | clear_bit(0, &sbc8360_is_open); |
287 | expect_close = 0; | 286 | expect_close = 0; |
@@ -334,20 +333,19 @@ static int __init sbc8360_init(void) | |||
334 | unsigned long int mseconds = 60000; | 333 | unsigned long int mseconds = 60000; |
335 | 334 | ||
336 | if (timeout < 0 || timeout > 63) { | 335 | if (timeout < 0 || timeout > 63) { |
337 | printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n"); | 336 | pr_err("Invalid timeout index (must be 0-63)\n"); |
338 | res = -EINVAL; | 337 | res = -EINVAL; |
339 | goto out; | 338 | goto out; |
340 | } | 339 | } |
341 | 340 | ||
342 | if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) { | 341 | if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) { |
343 | printk(KERN_ERR PFX "ENABLE method I/O %X is not available.\n", | 342 | pr_err("ENABLE method I/O %X is not available\n", |
344 | SBC8360_ENABLE); | 343 | SBC8360_ENABLE); |
345 | res = -EIO; | 344 | res = -EIO; |
346 | goto out; | 345 | goto out; |
347 | } | 346 | } |
348 | if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) { | 347 | if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) { |
349 | printk(KERN_ERR PFX | 348 | pr_err("BASETIME method I/O %X is not available\n", |
350 | "BASETIME method I/O %X is not available.\n", | ||
351 | SBC8360_BASETIME); | 349 | SBC8360_BASETIME); |
352 | res = -EIO; | 350 | res = -EIO; |
353 | goto out_nobasetimereg; | 351 | goto out_nobasetimereg; |
@@ -355,13 +353,13 @@ static int __init sbc8360_init(void) | |||
355 | 353 | ||
356 | res = register_reboot_notifier(&sbc8360_notifier); | 354 | res = register_reboot_notifier(&sbc8360_notifier); |
357 | if (res) { | 355 | if (res) { |
358 | printk(KERN_ERR PFX "Failed to register reboot notifier.\n"); | 356 | pr_err("Failed to register reboot notifier\n"); |
359 | goto out_noreboot; | 357 | goto out_noreboot; |
360 | } | 358 | } |
361 | 359 | ||
362 | res = misc_register(&sbc8360_miscdev); | 360 | res = misc_register(&sbc8360_miscdev); |
363 | if (res) { | 361 | if (res) { |
364 | printk(KERN_ERR PFX "failed to register misc device\n"); | 362 | pr_err("failed to register misc device\n"); |
365 | goto out_nomisc; | 363 | goto out_nomisc; |
366 | } | 364 | } |
367 | 365 | ||
@@ -378,7 +376,7 @@ static int __init sbc8360_init(void) | |||
378 | mseconds = (wd_margin + 1) * 100000; | 376 | mseconds = (wd_margin + 1) * 100000; |
379 | 377 | ||
380 | /* My kingdom for the ability to print "0.5 seconds" in the kernel! */ | 378 | /* My kingdom for the ability to print "0.5 seconds" in the kernel! */ |
381 | printk(KERN_INFO PFX "Timeout set at %ld ms.\n", mseconds); | 379 | pr_info("Timeout set at %ld ms\n", mseconds); |
382 | 380 | ||
383 | return 0; | 381 | return 0; |
384 | 382 | ||
diff --git a/drivers/watchdog/sbc_epx_c3.c b/drivers/watchdog/sbc_epx_c3.c index eaca366b7234..1a13d36c5f12 100644 --- a/drivers/watchdog/sbc_epx_c3.c +++ b/drivers/watchdog/sbc_epx_c3.c | |||
@@ -13,6 +13,8 @@ | |||
13 | * based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk> | 13 | * based on softdog.c by Alan Cox <alan@lxorguk.ukuu.org.uk> |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
17 | |||
16 | #include <linux/module.h> | 18 | #include <linux/module.h> |
17 | #include <linux/moduleparam.h> | 19 | #include <linux/moduleparam.h> |
18 | #include <linux/types.h> | 20 | #include <linux/types.h> |
@@ -28,7 +30,6 @@ | |||
28 | #include <linux/uaccess.h> | 30 | #include <linux/uaccess.h> |
29 | #include <linux/io.h> | 31 | #include <linux/io.h> |
30 | 32 | ||
31 | #define PFX "epx_c3: " | ||
32 | static int epx_c3_alive; | 33 | static int epx_c3_alive; |
33 | 34 | ||
34 | #define WATCHDOG_TIMEOUT 1 /* 1 sec default timeout */ | 35 | #define WATCHDOG_TIMEOUT 1 /* 1 sec default timeout */ |
@@ -51,7 +52,7 @@ static void epx_c3_stop(void) | |||
51 | 52 | ||
52 | outb(0, EPXC3_WATCHDOG_CTL_REG); | 53 | outb(0, EPXC3_WATCHDOG_CTL_REG); |
53 | 54 | ||
54 | printk(KERN_INFO PFX "Stopped watchdog timer.\n"); | 55 | pr_info("Stopped watchdog timer\n"); |
55 | } | 56 | } |
56 | 57 | ||
57 | static void epx_c3_pet(void) | 58 | static void epx_c3_pet(void) |
@@ -75,7 +76,7 @@ static int epx_c3_open(struct inode *inode, struct file *file) | |||
75 | epx_c3_pet(); | 76 | epx_c3_pet(); |
76 | 77 | ||
77 | epx_c3_alive = 1; | 78 | epx_c3_alive = 1; |
78 | printk(KERN_INFO "Started watchdog timer.\n"); | 79 | pr_info("Started watchdog timer\n"); |
79 | 80 | ||
80 | return nonseekable_open(inode, file); | 81 | return nonseekable_open(inode, file); |
81 | } | 82 | } |
@@ -173,9 +174,6 @@ static struct notifier_block epx_c3_notifier = { | |||
173 | .notifier_call = epx_c3_notify_sys, | 174 | .notifier_call = epx_c3_notify_sys, |
174 | }; | 175 | }; |
175 | 176 | ||
176 | static const char banner[] __initconst = KERN_INFO PFX | ||
177 | "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n"; | ||
178 | |||
179 | static int __init watchdog_init(void) | 177 | static int __init watchdog_init(void) |
180 | { | 178 | { |
181 | int ret; | 179 | int ret; |
@@ -185,20 +183,19 @@ static int __init watchdog_init(void) | |||
185 | 183 | ||
186 | ret = register_reboot_notifier(&epx_c3_notifier); | 184 | ret = register_reboot_notifier(&epx_c3_notifier); |
187 | if (ret) { | 185 | if (ret) { |
188 | printk(KERN_ERR PFX "cannot register reboot notifier " | 186 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
189 | "(err=%d)\n", ret); | ||
190 | goto out; | 187 | goto out; |
191 | } | 188 | } |
192 | 189 | ||
193 | ret = misc_register(&epx_c3_miscdev); | 190 | ret = misc_register(&epx_c3_miscdev); |
194 | if (ret) { | 191 | if (ret) { |
195 | printk(KERN_ERR PFX "cannot register miscdev on minor=%d " | 192 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
196 | "(err=%d)\n", WATCHDOG_MINOR, ret); | 193 | WATCHDOG_MINOR, ret); |
197 | unregister_reboot_notifier(&epx_c3_notifier); | 194 | unregister_reboot_notifier(&epx_c3_notifier); |
198 | goto out; | 195 | goto out; |
199 | } | 196 | } |
200 | 197 | ||
201 | printk(banner); | 198 | pr_info("Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n"); |
202 | 199 | ||
203 | return 0; | 200 | return 0; |
204 | 201 | ||
diff --git a/drivers/watchdog/sbc_fitpc2_wdt.c b/drivers/watchdog/sbc_fitpc2_wdt.c index d5d399464599..ca9c6c4360ee 100644 --- a/drivers/watchdog/sbc_fitpc2_wdt.c +++ b/drivers/watchdog/sbc_fitpc2_wdt.c | |||
@@ -171,8 +171,7 @@ static int fitpc2_wdt_release(struct inode *inode, struct file *file) | |||
171 | wdt_disable(); | 171 | wdt_disable(); |
172 | pr_info("Device disabled\n"); | 172 | pr_info("Device disabled\n"); |
173 | } else { | 173 | } else { |
174 | pr_warning("Device closed unexpectedly -" | 174 | pr_warn("Device closed unexpectedly - timer will not stop\n"); |
175 | " timer will not stop\n"); | ||
176 | wdt_enable(); | 175 | wdt_enable(); |
177 | } | 176 | } |
178 | 177 | ||
@@ -222,8 +221,8 @@ static int __init fitpc2_wdt_init(void) | |||
222 | } | 221 | } |
223 | 222 | ||
224 | if (margin < 31 || margin > 255) { | 223 | if (margin < 31 || margin > 255) { |
225 | pr_err("margin must be in range 31 - 255" | 224 | pr_err("margin must be in range 31 - 255 seconds, you tried to set %d\n", |
226 | " seconds, you tried to set %d\n", margin); | 225 | margin); |
227 | err = -EINVAL; | 226 | err = -EINVAL; |
228 | goto err_margin; | 227 | goto err_margin; |
229 | } | 228 | } |
@@ -231,7 +230,7 @@ static int __init fitpc2_wdt_init(void) | |||
231 | err = misc_register(&fitpc2_wdt_miscdev); | 230 | err = misc_register(&fitpc2_wdt_miscdev); |
232 | if (err) { | 231 | if (err) { |
233 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", | 232 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
234 | WATCHDOG_MINOR, err); | 233 | WATCHDOG_MINOR, err); |
235 | goto err_margin; | 234 | goto err_margin; |
236 | } | 235 | } |
237 | 236 | ||
diff --git a/drivers/watchdog/sc1200wdt.c b/drivers/watchdog/sc1200wdt.c index c01daca8405a..0698b3d794ea 100644 --- a/drivers/watchdog/sc1200wdt.c +++ b/drivers/watchdog/sc1200wdt.c | |||
@@ -31,6 +31,8 @@ | |||
31 | * | 31 | * |
32 | */ | 32 | */ |
33 | 33 | ||
34 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
35 | |||
34 | #include <linux/module.h> | 36 | #include <linux/module.h> |
35 | #include <linux/moduleparam.h> | 37 | #include <linux/moduleparam.h> |
36 | #include <linux/miscdevice.h> | 38 | #include <linux/miscdevice.h> |
@@ -48,7 +50,6 @@ | |||
48 | 50 | ||
49 | #define SC1200_MODULE_VER "build 20020303" | 51 | #define SC1200_MODULE_VER "build 20020303" |
50 | #define SC1200_MODULE_NAME "sc1200wdt" | 52 | #define SC1200_MODULE_NAME "sc1200wdt" |
51 | #define PFX SC1200_MODULE_NAME ": " | ||
52 | 53 | ||
53 | #define MAX_TIMEOUT 255 /* 255 minutes */ | 54 | #define MAX_TIMEOUT 255 /* 255 minutes */ |
54 | #define PMIR (io) /* Power Management Index Register */ | 55 | #define PMIR (io) /* Power Management Index Register */ |
@@ -71,7 +72,6 @@ | |||
71 | #define UART2_IRQ 0x04 /* Serial1 */ | 72 | #define UART2_IRQ 0x04 /* Serial1 */ |
72 | /* 5 -7 are reserved */ | 73 | /* 5 -7 are reserved */ |
73 | 74 | ||
74 | static char banner[] __initdata = PFX SC1200_MODULE_VER; | ||
75 | static int timeout = 1; | 75 | static int timeout = 1; |
76 | static int io = -1; | 76 | static int io = -1; |
77 | static int io_len = 2; /* for non plug and play */ | 77 | static int io_len = 2; /* for non plug and play */ |
@@ -176,7 +176,7 @@ static int sc1200wdt_open(struct inode *inode, struct file *file) | |||
176 | timeout = MAX_TIMEOUT; | 176 | timeout = MAX_TIMEOUT; |
177 | 177 | ||
178 | sc1200wdt_start(); | 178 | sc1200wdt_start(); |
179 | printk(KERN_INFO PFX "Watchdog enabled, timeout = %d min(s)", timeout); | 179 | pr_info("Watchdog enabled, timeout = %d min(s)", timeout); |
180 | 180 | ||
181 | return nonseekable_open(inode, file); | 181 | return nonseekable_open(inode, file); |
182 | } | 182 | } |
@@ -254,11 +254,10 @@ static int sc1200wdt_release(struct inode *inode, struct file *file) | |||
254 | { | 254 | { |
255 | if (expect_close == 42) { | 255 | if (expect_close == 42) { |
256 | sc1200wdt_stop(); | 256 | sc1200wdt_stop(); |
257 | printk(KERN_INFO PFX "Watchdog disabled\n"); | 257 | pr_info("Watchdog disabled\n"); |
258 | } else { | 258 | } else { |
259 | sc1200wdt_write_data(WDTO, timeout); | 259 | sc1200wdt_write_data(WDTO, timeout); |
260 | printk(KERN_CRIT PFX | 260 | pr_crit("Unexpected close!, timeout = %d min(s)\n", timeout); |
261 | "Unexpected close!, timeout = %d min(s)\n", timeout); | ||
262 | } | 261 | } |
263 | clear_bit(0, &open_flag); | 262 | clear_bit(0, &open_flag); |
264 | expect_close = 0; | 263 | expect_close = 0; |
@@ -361,12 +360,11 @@ static int scl200wdt_pnp_probe(struct pnp_dev *dev, | |||
361 | io_len = pnp_port_len(wdt_dev, 0); | 360 | io_len = pnp_port_len(wdt_dev, 0); |
362 | 361 | ||
363 | if (!request_region(io, io_len, SC1200_MODULE_NAME)) { | 362 | if (!request_region(io, io_len, SC1200_MODULE_NAME)) { |
364 | printk(KERN_ERR PFX "Unable to register IO port %#x\n", io); | 363 | pr_err("Unable to register IO port %#x\n", io); |
365 | return -EBUSY; | 364 | return -EBUSY; |
366 | } | 365 | } |
367 | 366 | ||
368 | printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", | 367 | pr_info("PnP device found at io port %#x/%d\n", io, io_len); |
369 | io, io_len); | ||
370 | return 0; | 368 | return 0; |
371 | } | 369 | } |
372 | 370 | ||
@@ -392,7 +390,7 @@ static int __init sc1200wdt_init(void) | |||
392 | { | 390 | { |
393 | int ret; | 391 | int ret; |
394 | 392 | ||
395 | printk(KERN_INFO "%s\n", banner); | 393 | pr_info("%s\n", SC1200_MODULE_VER); |
396 | 394 | ||
397 | #if defined CONFIG_PNP | 395 | #if defined CONFIG_PNP |
398 | if (isapnp) { | 396 | if (isapnp) { |
@@ -403,7 +401,7 @@ static int __init sc1200wdt_init(void) | |||
403 | #endif | 401 | #endif |
404 | 402 | ||
405 | if (io == -1) { | 403 | if (io == -1) { |
406 | printk(KERN_ERR PFX "io parameter must be specified\n"); | 404 | pr_err("io parameter must be specified\n"); |
407 | ret = -EINVAL; | 405 | ret = -EINVAL; |
408 | goto out_pnp; | 406 | goto out_pnp; |
409 | } | 407 | } |
@@ -416,7 +414,7 @@ static int __init sc1200wdt_init(void) | |||
416 | #endif | 414 | #endif |
417 | 415 | ||
418 | if (!request_region(io, io_len, SC1200_MODULE_NAME)) { | 416 | if (!request_region(io, io_len, SC1200_MODULE_NAME)) { |
419 | printk(KERN_ERR PFX "Unable to register IO port %#x\n", io); | 417 | pr_err("Unable to register IO port %#x\n", io); |
420 | ret = -EBUSY; | 418 | ret = -EBUSY; |
421 | goto out_pnp; | 419 | goto out_pnp; |
422 | } | 420 | } |
@@ -427,16 +425,14 @@ static int __init sc1200wdt_init(void) | |||
427 | 425 | ||
428 | ret = register_reboot_notifier(&sc1200wdt_notifier); | 426 | ret = register_reboot_notifier(&sc1200wdt_notifier); |
429 | if (ret) { | 427 | if (ret) { |
430 | printk(KERN_ERR PFX | 428 | pr_err("Unable to register reboot notifier err = %d\n", ret); |
431 | "Unable to register reboot notifier err = %d\n", ret); | ||
432 | goto out_io; | 429 | goto out_io; |
433 | } | 430 | } |
434 | 431 | ||
435 | ret = misc_register(&sc1200wdt_miscdev); | 432 | ret = misc_register(&sc1200wdt_miscdev); |
436 | if (ret) { | 433 | if (ret) { |
437 | printk(KERN_ERR PFX | 434 | pr_err("Unable to register miscdev on minor %d\n", |
438 | "Unable to register miscdev on minor %d\n", | 435 | WATCHDOG_MINOR); |
439 | WATCHDOG_MINOR); | ||
440 | goto out_rbt; | 436 | goto out_rbt; |
441 | } | 437 | } |
442 | 438 | ||
diff --git a/drivers/watchdog/sc520_wdt.c b/drivers/watchdog/sc520_wdt.c index b2840409ebc7..e975b3354381 100644 --- a/drivers/watchdog/sc520_wdt.c +++ b/drivers/watchdog/sc520_wdt.c | |||
@@ -52,6 +52,8 @@ | |||
52 | * This driver uses memory mapped IO, and spinlock. | 52 | * This driver uses memory mapped IO, and spinlock. |
53 | */ | 53 | */ |
54 | 54 | ||
55 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
56 | |||
55 | #include <linux/module.h> | 57 | #include <linux/module.h> |
56 | #include <linux/moduleparam.h> | 58 | #include <linux/moduleparam.h> |
57 | #include <linux/types.h> | 59 | #include <linux/types.h> |
@@ -69,9 +71,6 @@ | |||
69 | 71 | ||
70 | #include <asm/system.h> | 72 | #include <asm/system.h> |
71 | 73 | ||
72 | #define OUR_NAME "sc520_wdt" | ||
73 | #define PFX OUR_NAME ": " | ||
74 | |||
75 | /* | 74 | /* |
76 | * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7) | 75 | * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7) |
77 | * | 76 | * |
@@ -151,8 +150,7 @@ static void wdt_timer_ping(unsigned long data) | |||
151 | /* Re-set the timer interval */ | 150 | /* Re-set the timer interval */ |
152 | mod_timer(&timer, jiffies + WDT_INTERVAL); | 151 | mod_timer(&timer, jiffies + WDT_INTERVAL); |
153 | } else | 152 | } else |
154 | printk(KERN_WARNING PFX | 153 | pr_warn("Heartbeat lost! Will not ping the watchdog\n"); |
155 | "Heartbeat lost! Will not ping the watchdog\n"); | ||
156 | } | 154 | } |
157 | 155 | ||
158 | /* | 156 | /* |
@@ -187,7 +185,7 @@ static int wdt_startup(void) | |||
187 | /* Start the watchdog */ | 185 | /* Start the watchdog */ |
188 | wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); | 186 | wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); |
189 | 187 | ||
190 | printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); | 188 | pr_info("Watchdog timer is now enabled\n"); |
191 | return 0; | 189 | return 0; |
192 | } | 190 | } |
193 | 191 | ||
@@ -199,7 +197,7 @@ static int wdt_turnoff(void) | |||
199 | /* Stop the watchdog */ | 197 | /* Stop the watchdog */ |
200 | wdt_config(0); | 198 | wdt_config(0); |
201 | 199 | ||
202 | printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); | 200 | pr_info("Watchdog timer is now disabled...\n"); |
203 | return 0; | 201 | return 0; |
204 | } | 202 | } |
205 | 203 | ||
@@ -270,8 +268,7 @@ static int fop_close(struct inode *inode, struct file *file) | |||
270 | if (wdt_expect_close == 42) | 268 | if (wdt_expect_close == 42) |
271 | wdt_turnoff(); | 269 | wdt_turnoff(); |
272 | else { | 270 | else { |
273 | printk(KERN_CRIT PFX | 271 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
274 | "Unexpected close, not stopping watchdog!\n"); | ||
275 | wdt_keepalive(); | 272 | wdt_keepalive(); |
276 | } | 273 | } |
277 | clear_bit(0, &wdt_is_open); | 274 | clear_bit(0, &wdt_is_open); |
@@ -393,36 +390,32 @@ static int __init sc520_wdt_init(void) | |||
393 | if not reset to the default */ | 390 | if not reset to the default */ |
394 | if (wdt_set_heartbeat(timeout)) { | 391 | if (wdt_set_heartbeat(timeout)) { |
395 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 392 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |
396 | printk(KERN_INFO PFX | 393 | pr_info("timeout value must be 1 <= timeout <= 3600, using %d\n", |
397 | "timeout value must be 1 <= timeout <= 3600, using %d\n", | 394 | WATCHDOG_TIMEOUT); |
398 | WATCHDOG_TIMEOUT); | ||
399 | } | 395 | } |
400 | 396 | ||
401 | wdtmrctl = ioremap(MMCR_BASE + OFFS_WDTMRCTL, 2); | 397 | wdtmrctl = ioremap(MMCR_BASE + OFFS_WDTMRCTL, 2); |
402 | if (!wdtmrctl) { | 398 | if (!wdtmrctl) { |
403 | printk(KERN_ERR PFX "Unable to remap memory\n"); | 399 | pr_err("Unable to remap memory\n"); |
404 | rc = -ENOMEM; | 400 | rc = -ENOMEM; |
405 | goto err_out_region2; | 401 | goto err_out_region2; |
406 | } | 402 | } |
407 | 403 | ||
408 | rc = register_reboot_notifier(&wdt_notifier); | 404 | rc = register_reboot_notifier(&wdt_notifier); |
409 | if (rc) { | 405 | if (rc) { |
410 | printk(KERN_ERR PFX | 406 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
411 | "cannot register reboot notifier (err=%d)\n", rc); | ||
412 | goto err_out_ioremap; | 407 | goto err_out_ioremap; |
413 | } | 408 | } |
414 | 409 | ||
415 | rc = misc_register(&wdt_miscdev); | 410 | rc = misc_register(&wdt_miscdev); |
416 | if (rc) { | 411 | if (rc) { |
417 | printk(KERN_ERR PFX | 412 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
418 | "cannot register miscdev on minor=%d (err=%d)\n", | 413 | WATCHDOG_MINOR, rc); |
419 | WATCHDOG_MINOR, rc); | ||
420 | goto err_out_notifier; | 414 | goto err_out_notifier; |
421 | } | 415 | } |
422 | 416 | ||
423 | printk(KERN_INFO PFX | 417 | pr_info("WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n", |
424 | "WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n", | 418 | timeout, nowayout); |
425 | timeout, nowayout); | ||
426 | 419 | ||
427 | return 0; | 420 | return 0; |
428 | 421 | ||
diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c index 029467e34636..1702c3e9bce3 100644 --- a/drivers/watchdog/sch311x_wdt.c +++ b/drivers/watchdog/sch311x_wdt.c | |||
@@ -18,6 +18,8 @@ | |||
18 | * Includes, defines, variables, module parameters, ... | 18 | * Includes, defines, variables, module parameters, ... |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
22 | |||
21 | /* Includes */ | 23 | /* Includes */ |
22 | #include <linux/module.h> /* For module specific items */ | 24 | #include <linux/module.h> /* For module specific items */ |
23 | #include <linux/moduleparam.h> /* For new moduleparam's */ | 25 | #include <linux/moduleparam.h> /* For new moduleparam's */ |
@@ -37,7 +39,6 @@ | |||
37 | 39 | ||
38 | /* Module and version information */ | 40 | /* Module and version information */ |
39 | #define DRV_NAME "sch311x_wdt" | 41 | #define DRV_NAME "sch311x_wdt" |
40 | #define PFX DRV_NAME ": " | ||
41 | 42 | ||
42 | /* Runtime registers */ | 43 | /* Runtime registers */ |
43 | #define RESGEN 0x1d | 44 | #define RESGEN 0x1d |
@@ -323,8 +324,7 @@ static int sch311x_wdt_close(struct inode *inode, struct file *file) | |||
323 | if (sch311x_wdt_expect_close == 42) { | 324 | if (sch311x_wdt_expect_close == 42) { |
324 | sch311x_wdt_stop(); | 325 | sch311x_wdt_stop(); |
325 | } else { | 326 | } else { |
326 | printk(KERN_CRIT PFX | 327 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
327 | "Unexpected close, not stopping watchdog!\n"); | ||
328 | sch311x_wdt_keepalive(); | 328 | sch311x_wdt_keepalive(); |
329 | } | 329 | } |
330 | clear_bit(0, &sch311x_wdt_is_open); | 330 | clear_bit(0, &sch311x_wdt_is_open); |
@@ -504,20 +504,19 @@ static int __init sch311x_detect(int sio_config_port, unsigned short *addr) | |||
504 | 504 | ||
505 | /* Check if Logical Device Register is currently active */ | 505 | /* Check if Logical Device Register is currently active */ |
506 | if ((sch311x_sio_inb(sio_config_port, 0x30) & 0x01) == 0) | 506 | if ((sch311x_sio_inb(sio_config_port, 0x30) & 0x01) == 0) |
507 | printk(KERN_INFO PFX "Seems that LDN 0x0a is not active...\n"); | 507 | pr_info("Seems that LDN 0x0a is not active...\n"); |
508 | 508 | ||
509 | /* Get the base address of the runtime registers */ | 509 | /* Get the base address of the runtime registers */ |
510 | base_addr = (sch311x_sio_inb(sio_config_port, 0x60) << 8) | | 510 | base_addr = (sch311x_sio_inb(sio_config_port, 0x60) << 8) | |
511 | sch311x_sio_inb(sio_config_port, 0x61); | 511 | sch311x_sio_inb(sio_config_port, 0x61); |
512 | if (!base_addr) { | 512 | if (!base_addr) { |
513 | printk(KERN_ERR PFX "Base address not set.\n"); | 513 | pr_err("Base address not set\n"); |
514 | err = -ENODEV; | 514 | err = -ENODEV; |
515 | goto exit; | 515 | goto exit; |
516 | } | 516 | } |
517 | *addr = base_addr; | 517 | *addr = base_addr; |
518 | 518 | ||
519 | printk(KERN_INFO PFX "Found an SMSC SCH311%d chip at 0x%04x\n", | 519 | pr_info("Found an SMSC SCH311%d chip at 0x%04x\n", dev_id, base_addr); |
520 | dev_id, base_addr); | ||
521 | 520 | ||
522 | exit: | 521 | exit: |
523 | sch311x_sio_exit(sio_config_port); | 522 | sch311x_sio_exit(sio_config_port); |
diff --git a/drivers/watchdog/scx200_wdt.c b/drivers/watchdog/scx200_wdt.c index e67b76c0526c..35ada2e90664 100644 --- a/drivers/watchdog/scx200_wdt.c +++ b/drivers/watchdog/scx200_wdt.c | |||
@@ -17,6 +17,8 @@ | |||
17 | of any nature resulting due to the use of this software. This | 17 | of any nature resulting due to the use of this software. This |
18 | software is provided AS-IS with no warranties. */ | 18 | software is provided AS-IS with no warranties. */ |
19 | 19 | ||
20 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
21 | |||
20 | #include <linux/module.h> | 22 | #include <linux/module.h> |
21 | #include <linux/moduleparam.h> | 23 | #include <linux/moduleparam.h> |
22 | #include <linux/init.h> | 24 | #include <linux/init.h> |
@@ -30,7 +32,7 @@ | |||
30 | #include <linux/uaccess.h> | 32 | #include <linux/uaccess.h> |
31 | #include <linux/io.h> | 33 | #include <linux/io.h> |
32 | 34 | ||
33 | #define NAME "scx200_wdt" | 35 | #define DEBUG |
34 | 36 | ||
35 | MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); | 37 | MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); |
36 | MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); | 38 | MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); |
@@ -66,14 +68,13 @@ static void scx200_wdt_ping(void) | |||
66 | 68 | ||
67 | static void scx200_wdt_update_margin(void) | 69 | static void scx200_wdt_update_margin(void) |
68 | { | 70 | { |
69 | printk(KERN_INFO NAME ": timer margin %d seconds\n", margin); | 71 | pr_info("timer margin %d seconds\n", margin); |
70 | wdto_restart = margin * W_SCALE; | 72 | wdto_restart = margin * W_SCALE; |
71 | } | 73 | } |
72 | 74 | ||
73 | static void scx200_wdt_enable(void) | 75 | static void scx200_wdt_enable(void) |
74 | { | 76 | { |
75 | printk(KERN_DEBUG NAME ": enabling watchdog timer, wdto_restart = %d\n", | 77 | pr_debug("enabling watchdog timer, wdto_restart = %d\n", wdto_restart); |
76 | wdto_restart); | ||
77 | 78 | ||
78 | spin_lock(&scx_lock); | 79 | spin_lock(&scx_lock); |
79 | outw(0, scx200_cb_base + SCx200_WDT_WDTO); | 80 | outw(0, scx200_cb_base + SCx200_WDT_WDTO); |
@@ -86,7 +87,7 @@ static void scx200_wdt_enable(void) | |||
86 | 87 | ||
87 | static void scx200_wdt_disable(void) | 88 | static void scx200_wdt_disable(void) |
88 | { | 89 | { |
89 | printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); | 90 | pr_debug("disabling watchdog timer\n"); |
90 | 91 | ||
91 | spin_lock(&scx_lock); | 92 | spin_lock(&scx_lock); |
92 | outw(0, scx200_cb_base + SCx200_WDT_WDTO); | 93 | outw(0, scx200_cb_base + SCx200_WDT_WDTO); |
@@ -108,9 +109,7 @@ static int scx200_wdt_open(struct inode *inode, struct file *file) | |||
108 | static int scx200_wdt_release(struct inode *inode, struct file *file) | 109 | static int scx200_wdt_release(struct inode *inode, struct file *file) |
109 | { | 110 | { |
110 | if (expect_close != 42) | 111 | if (expect_close != 42) |
111 | printk(KERN_WARNING NAME | 112 | pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n"); |
112 | ": watchdog device closed unexpectedly, " | ||
113 | "will not disable the watchdog timer\n"); | ||
114 | else if (!nowayout) | 113 | else if (!nowayout) |
115 | scx200_wdt_disable(); | 114 | scx200_wdt_disable(); |
116 | expect_close = 0; | 115 | expect_close = 0; |
@@ -219,7 +218,7 @@ static int __init scx200_wdt_init(void) | |||
219 | { | 218 | { |
220 | int r; | 219 | int r; |
221 | 220 | ||
222 | printk(KERN_DEBUG NAME ": NatSemi SCx200 Watchdog Driver\n"); | 221 | pr_debug("NatSemi SCx200 Watchdog Driver\n"); |
223 | 222 | ||
224 | /* check that we have found the configuration block */ | 223 | /* check that we have found the configuration block */ |
225 | if (!scx200_cb_present()) | 224 | if (!scx200_cb_present()) |
@@ -228,7 +227,7 @@ static int __init scx200_wdt_init(void) | |||
228 | if (!request_region(scx200_cb_base + SCx200_WDT_OFFSET, | 227 | if (!request_region(scx200_cb_base + SCx200_WDT_OFFSET, |
229 | SCx200_WDT_SIZE, | 228 | SCx200_WDT_SIZE, |
230 | "NatSemi SCx200 Watchdog")) { | 229 | "NatSemi SCx200 Watchdog")) { |
231 | printk(KERN_WARNING NAME ": watchdog I/O region busy\n"); | 230 | pr_warn("watchdog I/O region busy\n"); |
232 | return -EBUSY; | 231 | return -EBUSY; |
233 | } | 232 | } |
234 | 233 | ||
@@ -237,7 +236,7 @@ static int __init scx200_wdt_init(void) | |||
237 | 236 | ||
238 | r = register_reboot_notifier(&scx200_wdt_notifier); | 237 | r = register_reboot_notifier(&scx200_wdt_notifier); |
239 | if (r) { | 238 | if (r) { |
240 | printk(KERN_ERR NAME ": unable to register reboot notifier"); | 239 | pr_err("unable to register reboot notifier\n"); |
241 | release_region(scx200_cb_base + SCx200_WDT_OFFSET, | 240 | release_region(scx200_cb_base + SCx200_WDT_OFFSET, |
242 | SCx200_WDT_SIZE); | 241 | SCx200_WDT_SIZE); |
243 | return r; | 242 | return r; |
diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c index a267dc078daf..75bd23926476 100644 --- a/drivers/watchdog/shwdt.c +++ b/drivers/watchdog/shwdt.c | |||
@@ -17,6 +17,9 @@ | |||
17 | * Added expect close support, made emulated timeout runtime changeable | 17 | * Added expect close support, made emulated timeout runtime changeable |
18 | * general cleanups, add some ioctls | 18 | * general cleanups, add some ioctls |
19 | */ | 19 | */ |
20 | |||
21 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
22 | |||
20 | #include <linux/module.h> | 23 | #include <linux/module.h> |
21 | #include <linux/moduleparam.h> | 24 | #include <linux/moduleparam.h> |
22 | #include <linux/platform_device.h> | 25 | #include <linux/platform_device.h> |
@@ -440,20 +443,20 @@ static int __init sh_wdt_init(void) | |||
440 | clock_division_ratio > 0x7)) { | 443 | clock_division_ratio > 0x7)) { |
441 | clock_division_ratio = WTCSR_CKS_4096; | 444 | clock_division_ratio = WTCSR_CKS_4096; |
442 | 445 | ||
443 | pr_info("%s: divisor must be 0x5<=x<=0x7, using %d\n", | 446 | pr_info("divisor must be 0x5<=x<=0x7, using %d\n", |
444 | DRV_NAME, clock_division_ratio); | 447 | clock_division_ratio); |
445 | } | 448 | } |
446 | 449 | ||
447 | rc = sh_wdt_set_heartbeat(heartbeat); | 450 | rc = sh_wdt_set_heartbeat(heartbeat); |
448 | if (unlikely(rc)) { | 451 | if (unlikely(rc)) { |
449 | heartbeat = WATCHDOG_HEARTBEAT; | 452 | heartbeat = WATCHDOG_HEARTBEAT; |
450 | 453 | ||
451 | pr_info("%s: heartbeat value must be 1<=x<=3600, using %d\n", | 454 | pr_info("heartbeat value must be 1<=x<=3600, using %d\n", |
452 | DRV_NAME, heartbeat); | 455 | heartbeat); |
453 | } | 456 | } |
454 | 457 | ||
455 | pr_info("%s: configured with heartbeat=%d sec (nowayout=%d)\n", | 458 | pr_info("configured with heartbeat=%d sec (nowayout=%d)\n", |
456 | DRV_NAME, heartbeat, nowayout); | 459 | heartbeat, nowayout); |
457 | 460 | ||
458 | return platform_driver_register(&sh_wdt_driver); | 461 | return platform_driver_register(&sh_wdt_driver); |
459 | } | 462 | } |
diff --git a/drivers/watchdog/smsc37b787_wdt.c b/drivers/watchdog/smsc37b787_wdt.c index 97b8184614ae..5e4d3734b516 100644 --- a/drivers/watchdog/smsc37b787_wdt.c +++ b/drivers/watchdog/smsc37b787_wdt.c | |||
@@ -43,6 +43,8 @@ | |||
43 | * Documentation/watchdog/wdt.txt | 43 | * Documentation/watchdog/wdt.txt |
44 | */ | 44 | */ |
45 | 45 | ||
46 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
47 | |||
46 | #include <linux/module.h> | 48 | #include <linux/module.h> |
47 | #include <linux/moduleparam.h> | 49 | #include <linux/moduleparam.h> |
48 | #include <linux/types.h> | 50 | #include <linux/types.h> |
@@ -70,7 +72,6 @@ | |||
70 | #define UNIT_SECOND 0 | 72 | #define UNIT_SECOND 0 |
71 | #define UNIT_MINUTE 1 | 73 | #define UNIT_MINUTE 1 |
72 | 74 | ||
73 | #define MODNAME "smsc37b787_wdt: " | ||
74 | #define VERSION "1.1" | 75 | #define VERSION "1.1" |
75 | 76 | ||
76 | #define IOPORT 0x3F0 | 77 | #define IOPORT 0x3F0 |
@@ -363,8 +364,7 @@ static int wb_smsc_wdt_open(struct inode *inode, struct file *file) | |||
363 | /* Reload and activate timer */ | 364 | /* Reload and activate timer */ |
364 | wb_smsc_wdt_enable(); | 365 | wb_smsc_wdt_enable(); |
365 | 366 | ||
366 | printk(KERN_INFO MODNAME | 367 | pr_info("Watchdog enabled. Timeout set to %d %s\n", |
367 | "Watchdog enabled. Timeout set to %d %s.\n", | ||
368 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); | 368 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); |
369 | 369 | ||
370 | return nonseekable_open(inode, file); | 370 | return nonseekable_open(inode, file); |
@@ -378,11 +378,9 @@ static int wb_smsc_wdt_release(struct inode *inode, struct file *file) | |||
378 | 378 | ||
379 | if (expect_close == 42) { | 379 | if (expect_close == 42) { |
380 | wb_smsc_wdt_disable(); | 380 | wb_smsc_wdt_disable(); |
381 | printk(KERN_INFO MODNAME | 381 | pr_info("Watchdog disabled, sleeping again...\n"); |
382 | "Watchdog disabled, sleeping again...\n"); | ||
383 | } else { | 382 | } else { |
384 | printk(KERN_CRIT MODNAME | 383 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
385 | "Unexpected close, not stopping watchdog!\n"); | ||
386 | wb_smsc_wdt_reset_timer(); | 384 | wb_smsc_wdt_reset_timer(); |
387 | } | 385 | } |
388 | 386 | ||
@@ -534,12 +532,11 @@ static int __init wb_smsc_wdt_init(void) | |||
534 | { | 532 | { |
535 | int ret; | 533 | int ret; |
536 | 534 | ||
537 | printk(KERN_INFO "SMsC 37B787 watchdog component driver " | 535 | pr_info("SMsC 37B787 watchdog component driver " |
538 | VERSION " initialising...\n"); | 536 | VERSION " initialising...\n"); |
539 | 537 | ||
540 | if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) { | 538 | if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) { |
541 | printk(KERN_ERR MODNAME "Unable to register IO port %#x\n", | 539 | pr_err("Unable to register IO port %#x\n", IOPORT); |
542 | IOPORT); | ||
543 | ret = -EBUSY; | 540 | ret = -EBUSY; |
544 | goto out_pnp; | 541 | goto out_pnp; |
545 | } | 542 | } |
@@ -553,25 +550,22 @@ static int __init wb_smsc_wdt_init(void) | |||
553 | 550 | ||
554 | ret = register_reboot_notifier(&wb_smsc_wdt_notifier); | 551 | ret = register_reboot_notifier(&wb_smsc_wdt_notifier); |
555 | if (ret) { | 552 | if (ret) { |
556 | printk(KERN_ERR MODNAME | 553 | pr_err("Unable to register reboot notifier err = %d\n", ret); |
557 | "Unable to register reboot notifier err = %d\n", ret); | ||
558 | goto out_io; | 554 | goto out_io; |
559 | } | 555 | } |
560 | 556 | ||
561 | ret = misc_register(&wb_smsc_wdt_miscdev); | 557 | ret = misc_register(&wb_smsc_wdt_miscdev); |
562 | if (ret) { | 558 | if (ret) { |
563 | printk(KERN_ERR MODNAME | 559 | pr_err("Unable to register miscdev on minor %d\n", |
564 | "Unable to register miscdev on minor %d\n", | 560 | WATCHDOG_MINOR); |
565 | WATCHDOG_MINOR); | ||
566 | goto out_rbt; | 561 | goto out_rbt; |
567 | } | 562 | } |
568 | 563 | ||
569 | /* output info */ | 564 | /* output info */ |
570 | printk(KERN_INFO MODNAME "Timeout set to %d %s.\n", | 565 | pr_info("Timeout set to %d %s\n", |
571 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); | 566 | timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); |
572 | printk(KERN_INFO MODNAME | 567 | pr_info("Watchdog initialized and sleeping (nowayout=%d)...\n", |
573 | "Watchdog initialized and sleeping (nowayout=%d)...\n", | 568 | nowayout); |
574 | nowayout); | ||
575 | out_clean: | 569 | out_clean: |
576 | return ret; | 570 | return ret; |
577 | 571 | ||
@@ -592,14 +586,14 @@ static void __exit wb_smsc_wdt_exit(void) | |||
592 | /* Stop the timer before we leave */ | 586 | /* Stop the timer before we leave */ |
593 | if (!nowayout) { | 587 | if (!nowayout) { |
594 | wb_smsc_wdt_shutdown(); | 588 | wb_smsc_wdt_shutdown(); |
595 | printk(KERN_INFO MODNAME "Watchdog disabled.\n"); | 589 | pr_info("Watchdog disabled\n"); |
596 | } | 590 | } |
597 | 591 | ||
598 | misc_deregister(&wb_smsc_wdt_miscdev); | 592 | misc_deregister(&wb_smsc_wdt_miscdev); |
599 | unregister_reboot_notifier(&wb_smsc_wdt_notifier); | 593 | unregister_reboot_notifier(&wb_smsc_wdt_notifier); |
600 | release_region(IOPORT, IOPORT_SIZE); | 594 | release_region(IOPORT, IOPORT_SIZE); |
601 | 595 | ||
602 | printk(KERN_INFO "SMsC 37B787 watchdog component driver removed.\n"); | 596 | pr_info("SMsC 37B787 watchdog component driver removed\n"); |
603 | } | 597 | } |
604 | 598 | ||
605 | module_init(wb_smsc_wdt_init); | 599 | module_init(wb_smsc_wdt_init); |
diff --git a/drivers/watchdog/softdog.c b/drivers/watchdog/softdog.c index bf16ffb4d21e..a1adc8c87832 100644 --- a/drivers/watchdog/softdog.c +++ b/drivers/watchdog/softdog.c | |||
@@ -36,6 +36,8 @@ | |||
36 | * Added Matt Domsch's nowayout module option. | 36 | * Added Matt Domsch's nowayout module option. |
37 | */ | 37 | */ |
38 | 38 | ||
39 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
40 | |||
39 | #include <linux/module.h> | 41 | #include <linux/module.h> |
40 | #include <linux/moduleparam.h> | 42 | #include <linux/moduleparam.h> |
41 | #include <linux/types.h> | 43 | #include <linux/types.h> |
@@ -50,8 +52,6 @@ | |||
50 | #include <linux/uaccess.h> | 52 | #include <linux/uaccess.h> |
51 | #include <linux/kernel.h> | 53 | #include <linux/kernel.h> |
52 | 54 | ||
53 | #define PFX "SoftDog: " | ||
54 | |||
55 | #define TIMER_MARGIN 60 /* Default is 60 seconds */ | 55 | #define TIMER_MARGIN 60 /* Default is 60 seconds */ |
56 | static int soft_margin = TIMER_MARGIN; /* in seconds */ | 56 | static int soft_margin = TIMER_MARGIN; /* in seconds */ |
57 | module_param(soft_margin, int, 0); | 57 | module_param(soft_margin, int, 0); |
@@ -103,14 +103,14 @@ static void watchdog_fire(unsigned long data) | |||
103 | module_put(THIS_MODULE); | 103 | module_put(THIS_MODULE); |
104 | 104 | ||
105 | if (soft_noboot) | 105 | if (soft_noboot) |
106 | printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n"); | 106 | pr_crit("Triggered - Reboot ignored\n"); |
107 | else if (soft_panic) { | 107 | else if (soft_panic) { |
108 | printk(KERN_CRIT PFX "Initiating panic.\n"); | 108 | pr_crit("Initiating panic\n"); |
109 | panic("Software Watchdog Timer expired."); | 109 | panic("Software Watchdog Timer expired"); |
110 | } else { | 110 | } else { |
111 | printk(KERN_CRIT PFX "Initiating system reboot.\n"); | 111 | pr_crit("Initiating system reboot\n"); |
112 | emergency_restart(); | 112 | emergency_restart(); |
113 | printk(KERN_CRIT PFX "Reboot didn't ?????\n"); | 113 | pr_crit("Reboot didn't ?????\n"); |
114 | } | 114 | } |
115 | } | 115 | } |
116 | 116 | ||
@@ -166,8 +166,7 @@ static int softdog_release(struct inode *inode, struct file *file) | |||
166 | softdog_stop(); | 166 | softdog_stop(); |
167 | module_put(THIS_MODULE); | 167 | module_put(THIS_MODULE); |
168 | } else { | 168 | } else { |
169 | printk(KERN_CRIT PFX | 169 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
170 | "Unexpected close, not stopping watchdog!\n"); | ||
171 | set_bit(0, &orphan_timer); | 170 | set_bit(0, &orphan_timer); |
172 | softdog_keepalive(); | 171 | softdog_keepalive(); |
173 | } | 172 | } |
@@ -275,10 +274,6 @@ static struct notifier_block softdog_notifier = { | |||
275 | .notifier_call = softdog_notify_sys, | 274 | .notifier_call = softdog_notify_sys, |
276 | }; | 275 | }; |
277 | 276 | ||
278 | static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.07 " | ||
279 | "initialized. soft_noboot=%d soft_margin=%d sec soft_panic=%d " | ||
280 | "(nowayout= %d)\n"; | ||
281 | |||
282 | static int __init watchdog_init(void) | 277 | static int __init watchdog_init(void) |
283 | { | 278 | { |
284 | int ret; | 279 | int ret; |
@@ -287,28 +282,26 @@ static int __init watchdog_init(void) | |||
287 | if not reset to the default */ | 282 | if not reset to the default */ |
288 | if (softdog_set_heartbeat(soft_margin)) { | 283 | if (softdog_set_heartbeat(soft_margin)) { |
289 | softdog_set_heartbeat(TIMER_MARGIN); | 284 | softdog_set_heartbeat(TIMER_MARGIN); |
290 | printk(KERN_INFO PFX | 285 | pr_info("soft_margin must be 0 < soft_margin < 65536, using %d\n", |
291 | "soft_margin must be 0 < soft_margin < 65536, using %d\n", | ||
292 | TIMER_MARGIN); | 286 | TIMER_MARGIN); |
293 | } | 287 | } |
294 | 288 | ||
295 | ret = register_reboot_notifier(&softdog_notifier); | 289 | ret = register_reboot_notifier(&softdog_notifier); |
296 | if (ret) { | 290 | if (ret) { |
297 | printk(KERN_ERR PFX | 291 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
298 | "cannot register reboot notifier (err=%d)\n", ret); | ||
299 | return ret; | 292 | return ret; |
300 | } | 293 | } |
301 | 294 | ||
302 | ret = misc_register(&softdog_miscdev); | 295 | ret = misc_register(&softdog_miscdev); |
303 | if (ret) { | 296 | if (ret) { |
304 | printk(KERN_ERR PFX | 297 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
305 | "cannot register miscdev on minor=%d (err=%d)\n", | 298 | WATCHDOG_MINOR, ret); |
306 | WATCHDOG_MINOR, ret); | ||
307 | unregister_reboot_notifier(&softdog_notifier); | 299 | unregister_reboot_notifier(&softdog_notifier); |
308 | return ret; | 300 | return ret; |
309 | } | 301 | } |
310 | 302 | ||
311 | printk(banner, soft_noboot, soft_margin, soft_panic, nowayout); | 303 | pr_info("Software Watchdog Timer: 0.07 initialized. soft_noboot=%d soft_margin=%d sec soft_panic=%d (nowayout= %d)\n", |
304 | soft_noboot, soft_margin, soft_panic, nowayout); | ||
312 | 305 | ||
313 | return 0; | 306 | return 0; |
314 | } | 307 | } |
diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 87e0527669d8..954a7b6334c4 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c | |||
@@ -20,6 +20,8 @@ | |||
20 | * Includes, defines, variables, module parameters, ... | 20 | * Includes, defines, variables, module parameters, ... |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
24 | |||
23 | #include <linux/module.h> | 25 | #include <linux/module.h> |
24 | #include <linux/moduleparam.h> | 26 | #include <linux/moduleparam.h> |
25 | #include <linux/types.h> | 27 | #include <linux/types.h> |
@@ -39,7 +41,6 @@ | |||
39 | #define TCO_VERSION "0.01" | 41 | #define TCO_VERSION "0.01" |
40 | #define TCO_MODULE_NAME "SP5100 TCO timer" | 42 | #define TCO_MODULE_NAME "SP5100 TCO timer" |
41 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION | 43 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION |
42 | #define PFX TCO_MODULE_NAME ": " | ||
43 | 44 | ||
44 | /* internal variables */ | 45 | /* internal variables */ |
45 | static u32 tcobase_phys; | 46 | static u32 tcobase_phys; |
@@ -143,8 +144,7 @@ static int sp5100_tco_release(struct inode *inode, struct file *file) | |||
143 | if (tco_expect_close == 42) { | 144 | if (tco_expect_close == 42) { |
144 | tco_timer_stop(); | 145 | tco_timer_stop(); |
145 | } else { | 146 | } else { |
146 | printk(KERN_CRIT PFX | 147 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
147 | "Unexpected close, not stopping watchdog!\n"); | ||
148 | tco_timer_keepalive(); | 148 | tco_timer_keepalive(); |
149 | } | 149 | } |
150 | clear_bit(0, &timer_alive); | 150 | clear_bit(0, &timer_alive); |
@@ -290,8 +290,7 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) | |||
290 | /* Request the IO ports used by this driver */ | 290 | /* Request the IO ports used by this driver */ |
291 | pm_iobase = SP5100_IO_PM_INDEX_REG; | 291 | pm_iobase = SP5100_IO_PM_INDEX_REG; |
292 | if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, "SP5100 TCO")) { | 292 | if (!request_region(pm_iobase, SP5100_PM_IOPORTS_SIZE, "SP5100 TCO")) { |
293 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 293 | pr_err("I/O address 0x%04x already in use\n", pm_iobase); |
294 | pm_iobase); | ||
295 | goto exit; | 294 | goto exit; |
296 | } | 295 | } |
297 | 296 | ||
@@ -308,15 +307,14 @@ static unsigned char __devinit sp5100_tco_setupdevice(void) | |||
308 | 307 | ||
309 | if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, | 308 | if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, |
310 | "SP5100 TCO")) { | 309 | "SP5100 TCO")) { |
311 | printk(KERN_ERR PFX "mmio address 0x%04x already in use\n", | 310 | pr_err("mmio address 0x%04x already in use\n", val); |
312 | val); | ||
313 | goto unreg_region; | 311 | goto unreg_region; |
314 | } | 312 | } |
315 | tcobase_phys = val; | 313 | tcobase_phys = val; |
316 | 314 | ||
317 | tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); | 315 | tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); |
318 | if (tcobase == 0) { | 316 | if (tcobase == 0) { |
319 | printk(KERN_ERR PFX "failed to get tcobase address\n"); | 317 | pr_err("failed to get tcobase address\n"); |
320 | goto unreg_mem_region; | 318 | goto unreg_mem_region; |
321 | } | 319 | } |
322 | 320 | ||
@@ -375,9 +373,9 @@ static int __devinit sp5100_tco_init(struct platform_device *dev) | |||
375 | return -ENODEV; | 373 | return -ENODEV; |
376 | 374 | ||
377 | /* Check to see if last reboot was due to watchdog timeout */ | 375 | /* Check to see if last reboot was due to watchdog timeout */ |
378 | printk(KERN_INFO PFX "Watchdog reboot %sdetected.\n", | 376 | pr_info("Watchdog reboot %sdetected\n", |
379 | readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? | 377 | readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? |
380 | "" : "not "); | 378 | "" : "not "); |
381 | 379 | ||
382 | /* Clear out the old status */ | 380 | /* Clear out the old status */ |
383 | val = readl(SP5100_WDT_CONTROL(tcobase)); | 381 | val = readl(SP5100_WDT_CONTROL(tcobase)); |
@@ -395,16 +393,14 @@ static int __devinit sp5100_tco_init(struct platform_device *dev) | |||
395 | 393 | ||
396 | ret = misc_register(&sp5100_tco_miscdev); | 394 | ret = misc_register(&sp5100_tco_miscdev); |
397 | if (ret != 0) { | 395 | if (ret != 0) { |
398 | printk(KERN_ERR PFX "cannot register miscdev on minor=" | 396 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
399 | "%d (err=%d)\n", | ||
400 | WATCHDOG_MINOR, ret); | 397 | WATCHDOG_MINOR, ret); |
401 | goto exit; | 398 | goto exit; |
402 | } | 399 | } |
403 | 400 | ||
404 | clear_bit(0, &timer_alive); | 401 | clear_bit(0, &timer_alive); |
405 | 402 | ||
406 | printk(KERN_INFO PFX "initialized (0x%p). heartbeat=%d sec" | 403 | pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", |
407 | " (nowayout=%d)\n", | ||
408 | tcobase, heartbeat, nowayout); | 404 | tcobase, heartbeat, nowayout); |
409 | 405 | ||
410 | return 0; | 406 | return 0; |
@@ -455,8 +451,7 @@ static int __init sp5100_tco_init_module(void) | |||
455 | { | 451 | { |
456 | int err; | 452 | int err; |
457 | 453 | ||
458 | printk(KERN_INFO PFX "SP5100 TCO WatchDog Timer Driver v%s\n", | 454 | pr_info("SP5100 TCO WatchDog Timer Driver v%s\n", TCO_VERSION); |
459 | TCO_VERSION); | ||
460 | 455 | ||
461 | err = platform_driver_register(&sp5100_tco_driver); | 456 | err = platform_driver_register(&sp5100_tco_driver); |
462 | if (err) | 457 | if (err) |
@@ -480,7 +475,7 @@ static void __exit sp5100_tco_cleanup_module(void) | |||
480 | { | 475 | { |
481 | platform_device_unregister(sp5100_tco_platform_device); | 476 | platform_device_unregister(sp5100_tco_platform_device); |
482 | platform_driver_unregister(&sp5100_tco_driver); | 477 | platform_driver_unregister(&sp5100_tco_driver); |
483 | printk(KERN_INFO PFX "SP5100 TCO Watchdog Module Unloaded.\n"); | 478 | pr_info("SP5100 TCO Watchdog Module Unloaded\n"); |
484 | } | 479 | } |
485 | 480 | ||
486 | module_init(sp5100_tco_init_module); | 481 | module_init(sp5100_tco_init_module); |
diff --git a/drivers/watchdog/stmp3xxx_wdt.c b/drivers/watchdog/stmp3xxx_wdt.c index e37d81178b9e..180941375cec 100644 --- a/drivers/watchdog/stmp3xxx_wdt.c +++ b/drivers/watchdog/stmp3xxx_wdt.c | |||
@@ -6,6 +6,9 @@ | |||
6 | * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. | 6 | * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. |
7 | * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. | 7 | * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. |
8 | */ | 8 | */ |
9 | |||
10 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
11 | |||
9 | #include <linux/init.h> | 12 | #include <linux/init.h> |
10 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
11 | #include <linux/fs.h> | 14 | #include <linux/fs.h> |
@@ -221,8 +224,7 @@ static int __devinit stmp3xxx_wdt_probe(struct platform_device *pdev) | |||
221 | return ret; | 224 | return ret; |
222 | } | 225 | } |
223 | 226 | ||
224 | printk(KERN_INFO "stmp3xxx watchdog: initialized, heartbeat %d sec\n", | 227 | pr_info("initialized, heartbeat %d sec\n", heartbeat); |
225 | heartbeat); | ||
226 | 228 | ||
227 | return ret; | 229 | return ret; |
228 | } | 230 | } |
diff --git a/drivers/watchdog/txx9wdt.c b/drivers/watchdog/txx9wdt.c index 9e9ed7bfabcb..99204a808698 100644 --- a/drivers/watchdog/txx9wdt.c +++ b/drivers/watchdog/txx9wdt.c | |||
@@ -7,6 +7,9 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | |||
11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
12 | |||
10 | #include <linux/module.h> | 13 | #include <linux/module.h> |
11 | #include <linux/moduleparam.h> | 14 | #include <linux/moduleparam.h> |
12 | #include <linux/types.h> | 15 | #include <linux/types.h> |
@@ -96,8 +99,7 @@ static int txx9wdt_release(struct inode *inode, struct file *file) | |||
96 | if (expect_close) | 99 | if (expect_close) |
97 | txx9wdt_stop(); | 100 | txx9wdt_stop(); |
98 | else { | 101 | else { |
99 | printk(KERN_CRIT "txx9wdt: " | 102 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
100 | "Unexpected close, not stopping watchdog!\n"); | ||
101 | txx9wdt_ping(); | 103 | txx9wdt_ping(); |
102 | } | 104 | } |
103 | clear_bit(0, &txx9wdt_alive); | 105 | clear_bit(0, &txx9wdt_alive); |
@@ -213,9 +215,8 @@ static int __init txx9wdt_probe(struct platform_device *dev) | |||
213 | goto exit; | 215 | goto exit; |
214 | } | 216 | } |
215 | 217 | ||
216 | printk(KERN_INFO "Hardware Watchdog Timer for TXx9: " | 218 | pr_info("Hardware Watchdog Timer: timeout=%d sec (max %ld) (nowayout= %d)\n", |
217 | "timeout=%d sec (max %ld) (nowayout= %d)\n", | 219 | timeout, WD_MAX_TIMEOUT, nowayout); |
218 | timeout, WD_MAX_TIMEOUT, nowayout); | ||
219 | 220 | ||
220 | return 0; | 221 | return 0; |
221 | exit_busy: | 222 | exit_busy: |
diff --git a/drivers/watchdog/via_wdt.c b/drivers/watchdog/via_wdt.c index 8f07dd4bd94a..bacbbc9e7443 100644 --- a/drivers/watchdog/via_wdt.c +++ b/drivers/watchdog/via_wdt.c | |||
@@ -10,6 +10,9 @@ | |||
10 | * Caveat: PnP must be enabled in BIOS to allow full access to watchdog | 10 | * Caveat: PnP must be enabled in BIOS to allow full access to watchdog |
11 | * control registers. If not, the watchdog must be configured in BIOS manually. | 11 | * control registers. If not, the watchdog must be configured in BIOS manually. |
12 | */ | 12 | */ |
13 | |||
14 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
15 | |||
13 | #include <linux/device.h> | 16 | #include <linux/device.h> |
14 | #include <linux/io.h> | 17 | #include <linux/io.h> |
15 | #include <linux/jiffies.h> | 18 | #include <linux/jiffies.h> |
diff --git a/drivers/watchdog/w83627hf_wdt.c b/drivers/watchdog/w83627hf_wdt.c index 576a388a1164..969358732841 100644 --- a/drivers/watchdog/w83627hf_wdt.c +++ b/drivers/watchdog/w83627hf_wdt.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> | 26 | * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk> |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/module.h> | 31 | #include <linux/module.h> |
30 | #include <linux/moduleparam.h> | 32 | #include <linux/moduleparam.h> |
31 | #include <linux/types.h> | 33 | #include <linux/types.h> |
@@ -43,7 +45,6 @@ | |||
43 | #include <asm/system.h> | 45 | #include <asm/system.h> |
44 | 46 | ||
45 | #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" | 47 | #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" |
46 | #define PFX WATCHDOG_NAME ": " | ||
47 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 48 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
48 | 49 | ||
49 | static unsigned long wdt_is_open; | 50 | static unsigned long wdt_is_open; |
@@ -119,9 +120,8 @@ static void w83627hf_init(void) | |||
119 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | 120 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ |
120 | t = inb_p(WDT_EFDR); /* read CRF6 */ | 121 | t = inb_p(WDT_EFDR); /* read CRF6 */ |
121 | if (t != 0) { | 122 | if (t != 0) { |
122 | printk(KERN_INFO PFX | 123 | pr_info("Watchdog already running. Resetting timeout to %d sec\n", |
123 | "Watchdog already running. Resetting timeout to %d sec\n", | 124 | timeout); |
124 | timeout); | ||
125 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ | 125 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ |
126 | } | 126 | } |
127 | 127 | ||
@@ -290,8 +290,7 @@ static int wdt_close(struct inode *inode, struct file *file) | |||
290 | if (expect_close == 42) | 290 | if (expect_close == 42) |
291 | wdt_disable(); | 291 | wdt_disable(); |
292 | else { | 292 | else { |
293 | printk(KERN_CRIT PFX | 293 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
294 | "Unexpected close, not stopping watchdog!\n"); | ||
295 | wdt_ping(); | 294 | wdt_ping(); |
296 | } | 295 | } |
297 | expect_close = 0; | 296 | expect_close = 0; |
@@ -344,18 +343,16 @@ static int __init wdt_init(void) | |||
344 | { | 343 | { |
345 | int ret; | 344 | int ret; |
346 | 345 | ||
347 | printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising.\n"); | 346 | pr_info("WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising\n"); |
348 | 347 | ||
349 | if (wdt_set_heartbeat(timeout)) { | 348 | if (wdt_set_heartbeat(timeout)) { |
350 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 349 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |
351 | printk(KERN_INFO PFX | 350 | pr_info("timeout value must be 1 <= timeout <= 255, using %d\n", |
352 | "timeout value must be 1 <= timeout <= 255, using %d\n", | 351 | WATCHDOG_TIMEOUT); |
353 | WATCHDOG_TIMEOUT); | ||
354 | } | 352 | } |
355 | 353 | ||
356 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { | 354 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { |
357 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 355 | pr_err("I/O address 0x%04x already in use\n", wdt_io); |
358 | wdt_io); | ||
359 | ret = -EIO; | 356 | ret = -EIO; |
360 | goto out; | 357 | goto out; |
361 | } | 358 | } |
@@ -364,22 +361,19 @@ static int __init wdt_init(void) | |||
364 | 361 | ||
365 | ret = register_reboot_notifier(&wdt_notifier); | 362 | ret = register_reboot_notifier(&wdt_notifier); |
366 | if (ret != 0) { | 363 | if (ret != 0) { |
367 | printk(KERN_ERR PFX | 364 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
368 | "cannot register reboot notifier (err=%d)\n", ret); | ||
369 | goto unreg_regions; | 365 | goto unreg_regions; |
370 | } | 366 | } |
371 | 367 | ||
372 | ret = misc_register(&wdt_miscdev); | 368 | ret = misc_register(&wdt_miscdev); |
373 | if (ret != 0) { | 369 | if (ret != 0) { |
374 | printk(KERN_ERR PFX | 370 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
375 | "cannot register miscdev on minor=%d (err=%d)\n", | 371 | WATCHDOG_MINOR, ret); |
376 | WATCHDOG_MINOR, ret); | ||
377 | goto unreg_reboot; | 372 | goto unreg_reboot; |
378 | } | 373 | } |
379 | 374 | ||
380 | printk(KERN_INFO PFX | 375 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
381 | "initialized. timeout=%d sec (nowayout=%d)\n", | 376 | timeout, nowayout); |
382 | timeout, nowayout); | ||
383 | 377 | ||
384 | out: | 378 | out: |
385 | return ret; | 379 | return ret; |
diff --git a/drivers/watchdog/w83697hf_wdt.c b/drivers/watchdog/w83697hf_wdt.c index af08972de506..23074184c214 100644 --- a/drivers/watchdog/w83697hf_wdt.c +++ b/drivers/watchdog/w83697hf_wdt.c | |||
@@ -25,6 +25,8 @@ | |||
25 | * "AS-IS" and at no charge. | 25 | * "AS-IS" and at no charge. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
29 | |||
28 | #include <linux/module.h> | 30 | #include <linux/module.h> |
29 | #include <linux/moduleparam.h> | 31 | #include <linux/moduleparam.h> |
30 | #include <linux/types.h> | 32 | #include <linux/types.h> |
@@ -42,7 +44,6 @@ | |||
42 | #include <asm/system.h> | 44 | #include <asm/system.h> |
43 | 45 | ||
44 | #define WATCHDOG_NAME "w83697hf/hg WDT" | 46 | #define WATCHDOG_NAME "w83697hf/hg WDT" |
45 | #define PFX WATCHDOG_NAME ": " | ||
46 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 47 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
47 | #define WATCHDOG_EARLY_DISABLE 1 /* Disable until userland kicks in */ | 48 | #define WATCHDOG_EARLY_DISABLE 1 /* Disable until userland kicks in */ |
48 | 49 | ||
@@ -309,8 +310,7 @@ static int wdt_close(struct inode *inode, struct file *file) | |||
309 | if (expect_close == 42) | 310 | if (expect_close == 42) |
310 | wdt_disable(); | 311 | wdt_disable(); |
311 | else { | 312 | else { |
312 | printk(KERN_CRIT PFX | 313 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
313 | "Unexpected close, not stopping watchdog!\n"); | ||
314 | wdt_ping(); | 314 | wdt_ping(); |
315 | } | 315 | } |
316 | expect_close = 0; | 316 | expect_close = 0; |
@@ -362,24 +362,21 @@ static struct notifier_block wdt_notifier = { | |||
362 | static int w83697hf_check_wdt(void) | 362 | static int w83697hf_check_wdt(void) |
363 | { | 363 | { |
364 | if (!request_region(wdt_io, 2, WATCHDOG_NAME)) { | 364 | if (!request_region(wdt_io, 2, WATCHDOG_NAME)) { |
365 | printk(KERN_ERR PFX | 365 | pr_err("I/O address 0x%x already in use\n", wdt_io); |
366 | "I/O address 0x%x already in use\n", wdt_io); | ||
367 | return -EIO; | 366 | return -EIO; |
368 | } | 367 | } |
369 | 368 | ||
370 | printk(KERN_DEBUG PFX | 369 | pr_debug("Looking for watchdog at address 0x%x\n", wdt_io); |
371 | "Looking for watchdog at address 0x%x\n", wdt_io); | ||
372 | w83697hf_unlock(); | 370 | w83697hf_unlock(); |
373 | if (w83697hf_get_reg(0x20) == 0x60) { | 371 | if (w83697hf_get_reg(0x20) == 0x60) { |
374 | printk(KERN_INFO PFX | 372 | pr_info("watchdog found at address 0x%x\n", wdt_io); |
375 | "watchdog found at address 0x%x\n", wdt_io); | ||
376 | w83697hf_lock(); | 373 | w83697hf_lock(); |
377 | return 0; | 374 | return 0; |
378 | } | 375 | } |
379 | /* Reprotect in case it was a compatible device */ | 376 | /* Reprotect in case it was a compatible device */ |
380 | w83697hf_lock(); | 377 | w83697hf_lock(); |
381 | 378 | ||
382 | printk(KERN_INFO PFX "watchdog not found at address 0x%x\n", wdt_io); | 379 | pr_info("watchdog not found at address 0x%x\n", wdt_io); |
383 | release_region(wdt_io, 2); | 380 | release_region(wdt_io, 2); |
384 | return -EIO; | 381 | return -EIO; |
385 | } | 382 | } |
@@ -390,7 +387,7 @@ static int __init wdt_init(void) | |||
390 | { | 387 | { |
391 | int ret, i, found = 0; | 388 | int ret, i, found = 0; |
392 | 389 | ||
393 | printk(KERN_INFO PFX "WDT driver for W83697HF/HG initializing\n"); | 390 | pr_info("WDT driver for W83697HF/HG initializing\n"); |
394 | 391 | ||
395 | if (wdt_io == 0) { | 392 | if (wdt_io == 0) { |
396 | /* we will autodetect the W83697HF/HG watchdog */ | 393 | /* we will autodetect the W83697HF/HG watchdog */ |
@@ -405,7 +402,7 @@ static int __init wdt_init(void) | |||
405 | } | 402 | } |
406 | 403 | ||
407 | if (!found) { | 404 | if (!found) { |
408 | printk(KERN_ERR PFX "No W83697HF/HG could be found\n"); | 405 | pr_err("No W83697HF/HG could be found\n"); |
409 | ret = -EIO; | 406 | ret = -EIO; |
410 | goto out; | 407 | goto out; |
411 | } | 408 | } |
@@ -413,34 +410,30 @@ static int __init wdt_init(void) | |||
413 | w83697hf_init(); | 410 | w83697hf_init(); |
414 | if (early_disable) { | 411 | if (early_disable) { |
415 | if (wdt_running()) | 412 | if (wdt_running()) |
416 | printk(KERN_WARNING PFX "Stopping previously enabled " | 413 | pr_warn("Stopping previously enabled watchdog until userland kicks in\n"); |
417 | "watchdog until userland kicks in\n"); | ||
418 | wdt_disable(); | 414 | wdt_disable(); |
419 | } | 415 | } |
420 | 416 | ||
421 | if (wdt_set_heartbeat(timeout)) { | 417 | if (wdt_set_heartbeat(timeout)) { |
422 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 418 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |
423 | printk(KERN_INFO PFX | 419 | pr_info("timeout value must be 1 <= timeout <= 255, using %d\n", |
424 | "timeout value must be 1 <= timeout <= 255, using %d\n", | 420 | WATCHDOG_TIMEOUT); |
425 | WATCHDOG_TIMEOUT); | ||
426 | } | 421 | } |
427 | 422 | ||
428 | ret = register_reboot_notifier(&wdt_notifier); | 423 | ret = register_reboot_notifier(&wdt_notifier); |
429 | if (ret != 0) { | 424 | if (ret != 0) { |
430 | printk(KERN_ERR PFX | 425 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
431 | "cannot register reboot notifier (err=%d)\n", ret); | ||
432 | goto unreg_regions; | 426 | goto unreg_regions; |
433 | } | 427 | } |
434 | 428 | ||
435 | ret = misc_register(&wdt_miscdev); | 429 | ret = misc_register(&wdt_miscdev); |
436 | if (ret != 0) { | 430 | if (ret != 0) { |
437 | printk(KERN_ERR PFX | 431 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
438 | "cannot register miscdev on minor=%d (err=%d)\n", | 432 | WATCHDOG_MINOR, ret); |
439 | WATCHDOG_MINOR, ret); | ||
440 | goto unreg_reboot; | 433 | goto unreg_reboot; |
441 | } | 434 | } |
442 | 435 | ||
443 | printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | 436 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
444 | timeout, nowayout); | 437 | timeout, nowayout); |
445 | 438 | ||
446 | out: | 439 | out: |
diff --git a/drivers/watchdog/w83697ug_wdt.c b/drivers/watchdog/w83697ug_wdt.c index be9c4d839e15..025736bacf5f 100644 --- a/drivers/watchdog/w83697ug_wdt.c +++ b/drivers/watchdog/w83697ug_wdt.c | |||
@@ -30,6 +30,8 @@ | |||
30 | * (c) Copyright 1995 Alan Cox <alan@redhat.com> | 30 | * (c) Copyright 1995 Alan Cox <alan@redhat.com> |
31 | */ | 31 | */ |
32 | 32 | ||
33 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
34 | |||
33 | #include <linux/module.h> | 35 | #include <linux/module.h> |
34 | #include <linux/moduleparam.h> | 36 | #include <linux/moduleparam.h> |
35 | #include <linux/types.h> | 37 | #include <linux/types.h> |
@@ -47,7 +49,6 @@ | |||
47 | #include <asm/system.h> | 49 | #include <asm/system.h> |
48 | 50 | ||
49 | #define WATCHDOG_NAME "w83697ug/uf WDT" | 51 | #define WATCHDOG_NAME "w83697ug/uf WDT" |
50 | #define PFX WATCHDOG_NAME ": " | ||
51 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ | 52 | #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ |
52 | 53 | ||
53 | static unsigned long wdt_is_open; | 54 | static unsigned long wdt_is_open; |
@@ -91,8 +92,8 @@ static int w83697ug_select_wd_register(void) | |||
91 | version = inb(WDT_EFDR); | 92 | version = inb(WDT_EFDR); |
92 | 93 | ||
93 | if (version == 0x68) { /* W83697UG */ | 94 | if (version == 0x68) { /* W83697UG */ |
94 | printk(KERN_INFO PFX "Watchdog chip version 0x%02x = " | 95 | pr_info("Watchdog chip version 0x%02x = W83697UG/UF found at 0x%04x\n", |
95 | "W83697UG/UF found at 0x%04x\n", version, wdt_io); | 96 | version, wdt_io); |
96 | 97 | ||
97 | outb_p(0x2b, WDT_EFER); | 98 | outb_p(0x2b, WDT_EFER); |
98 | c = inb_p(WDT_EFDR); /* select WDT0 */ | 99 | c = inb_p(WDT_EFDR); /* select WDT0 */ |
@@ -101,7 +102,7 @@ static int w83697ug_select_wd_register(void) | |||
101 | outb_p(c, WDT_EFDR); /* set pin118 to WDT0 */ | 102 | outb_p(c, WDT_EFDR); /* set pin118 to WDT0 */ |
102 | 103 | ||
103 | } else { | 104 | } else { |
104 | printk(KERN_ERR PFX "No W83697UG/UF could be found\n"); | 105 | pr_err("No W83697UG/UF could be found\n"); |
105 | return -ENODEV; | 106 | return -ENODEV; |
106 | } | 107 | } |
107 | 108 | ||
@@ -131,8 +132,8 @@ static int w83697ug_init(void) | |||
131 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ | 132 | outb_p(0xF6, WDT_EFER); /* Select CRF6 */ |
132 | t = inb_p(WDT_EFDR); /* read CRF6 */ | 133 | t = inb_p(WDT_EFDR); /* read CRF6 */ |
133 | if (t != 0) { | 134 | if (t != 0) { |
134 | printk(KERN_INFO PFX "Watchdog already running." | 135 | pr_info("Watchdog already running. Resetting timeout to %d sec\n", |
135 | " Resetting timeout to %d sec\n", timeout); | 136 | timeout); |
136 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ | 137 | outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ |
137 | } | 138 | } |
138 | outb_p(0xF5, WDT_EFER); /* Select CRF5 */ | 139 | outb_p(0xF5, WDT_EFER); /* Select CRF5 */ |
@@ -286,8 +287,7 @@ static int wdt_close(struct inode *inode, struct file *file) | |||
286 | if (expect_close == 42) | 287 | if (expect_close == 42) |
287 | wdt_disable(); | 288 | wdt_disable(); |
288 | else { | 289 | else { |
289 | printk(KERN_CRIT PFX | 290 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
290 | "Unexpected close, not stopping watchdog!\n"); | ||
291 | wdt_ping(); | 291 | wdt_ping(); |
292 | } | 292 | } |
293 | expect_close = 0; | 293 | expect_close = 0; |
@@ -340,18 +340,16 @@ static int __init wdt_init(void) | |||
340 | { | 340 | { |
341 | int ret; | 341 | int ret; |
342 | 342 | ||
343 | printk(KERN_INFO "WDT driver for the Winbond(TM) W83697UG/UF Super I/O chip initialising.\n"); | 343 | pr_info("WDT driver for the Winbond(TM) W83697UG/UF Super I/O chip initialising\n"); |
344 | 344 | ||
345 | if (wdt_set_heartbeat(timeout)) { | 345 | if (wdt_set_heartbeat(timeout)) { |
346 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); | 346 | wdt_set_heartbeat(WATCHDOG_TIMEOUT); |
347 | printk(KERN_INFO PFX | 347 | pr_info("timeout value must be 1<=timeout<=255, using %d\n", |
348 | "timeout value must be 1<=timeout<=255, using %d\n", | ||
349 | WATCHDOG_TIMEOUT); | 348 | WATCHDOG_TIMEOUT); |
350 | } | 349 | } |
351 | 350 | ||
352 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { | 351 | if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { |
353 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 352 | pr_err("I/O address 0x%04x already in use\n", wdt_io); |
354 | wdt_io); | ||
355 | ret = -EIO; | 353 | ret = -EIO; |
356 | goto out; | 354 | goto out; |
357 | } | 355 | } |
@@ -362,20 +360,18 @@ static int __init wdt_init(void) | |||
362 | 360 | ||
363 | ret = register_reboot_notifier(&wdt_notifier); | 361 | ret = register_reboot_notifier(&wdt_notifier); |
364 | if (ret != 0) { | 362 | if (ret != 0) { |
365 | printk(KERN_ERR PFX | 363 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
366 | "cannot register reboot notifier (err=%d)\n", ret); | ||
367 | goto unreg_regions; | 364 | goto unreg_regions; |
368 | } | 365 | } |
369 | 366 | ||
370 | ret = misc_register(&wdt_miscdev); | 367 | ret = misc_register(&wdt_miscdev); |
371 | if (ret != 0) { | 368 | if (ret != 0) { |
372 | printk(KERN_ERR PFX | 369 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
373 | "cannot register miscdev on minor=%d (err=%d)\n", | 370 | WATCHDOG_MINOR, ret); |
374 | WATCHDOG_MINOR, ret); | ||
375 | goto unreg_reboot; | 371 | goto unreg_reboot; |
376 | } | 372 | } |
377 | 373 | ||
378 | printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | 374 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
379 | timeout, nowayout); | 375 | timeout, nowayout); |
380 | 376 | ||
381 | out: | 377 | out: |
diff --git a/drivers/watchdog/w83877f_wdt.c b/drivers/watchdog/w83877f_wdt.c index 24587d2060c4..d761414de809 100644 --- a/drivers/watchdog/w83877f_wdt.c +++ b/drivers/watchdog/w83877f_wdt.c | |||
@@ -42,6 +42,8 @@ | |||
42 | * daemon always getting scheduled within that time frame. | 42 | * daemon always getting scheduled within that time frame. |
43 | */ | 43 | */ |
44 | 44 | ||
45 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
46 | |||
45 | #include <linux/module.h> | 47 | #include <linux/module.h> |
46 | #include <linux/moduleparam.h> | 48 | #include <linux/moduleparam.h> |
47 | #include <linux/types.h> | 49 | #include <linux/types.h> |
@@ -59,7 +61,6 @@ | |||
59 | #include <asm/system.h> | 61 | #include <asm/system.h> |
60 | 62 | ||
61 | #define OUR_NAME "w83877f_wdt" | 63 | #define OUR_NAME "w83877f_wdt" |
62 | #define PFX OUR_NAME ": " | ||
63 | 64 | ||
64 | #define ENABLE_W83877F_PORT 0x3F0 | 65 | #define ENABLE_W83877F_PORT 0x3F0 |
65 | #define ENABLE_W83877F 0x87 | 66 | #define ENABLE_W83877F 0x87 |
@@ -126,8 +127,7 @@ static void wdt_timer_ping(unsigned long data) | |||
126 | spin_unlock(&wdt_spinlock); | 127 | spin_unlock(&wdt_spinlock); |
127 | 128 | ||
128 | } else | 129 | } else |
129 | printk(KERN_WARNING PFX | 130 | pr_warn("Heartbeat lost! Will not ping the watchdog\n"); |
130 | "Heartbeat lost! Will not ping the watchdog\n"); | ||
131 | } | 131 | } |
132 | 132 | ||
133 | /* | 133 | /* |
@@ -165,7 +165,7 @@ static void wdt_startup(void) | |||
165 | 165 | ||
166 | wdt_change(WDT_ENABLE); | 166 | wdt_change(WDT_ENABLE); |
167 | 167 | ||
168 | printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); | 168 | pr_info("Watchdog timer is now enabled\n"); |
169 | } | 169 | } |
170 | 170 | ||
171 | static void wdt_turnoff(void) | 171 | static void wdt_turnoff(void) |
@@ -175,7 +175,7 @@ static void wdt_turnoff(void) | |||
175 | 175 | ||
176 | wdt_change(WDT_DISABLE); | 176 | wdt_change(WDT_DISABLE); |
177 | 177 | ||
178 | printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); | 178 | pr_info("Watchdog timer is now disabled...\n"); |
179 | } | 179 | } |
180 | 180 | ||
181 | static void wdt_keepalive(void) | 181 | static void wdt_keepalive(void) |
@@ -234,8 +234,7 @@ static int fop_close(struct inode *inode, struct file *file) | |||
234 | wdt_turnoff(); | 234 | wdt_turnoff(); |
235 | else { | 235 | else { |
236 | del_timer(&timer); | 236 | del_timer(&timer); |
237 | printk(KERN_CRIT PFX | 237 | pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); |
238 | "device file closed unexpectedly. Will not stop the WDT!\n"); | ||
239 | } | 238 | } |
240 | clear_bit(0, &wdt_is_open); | 239 | clear_bit(0, &wdt_is_open); |
241 | wdt_expect_close = 0; | 240 | wdt_expect_close = 0; |
@@ -357,42 +356,37 @@ static int __init w83877f_wdt_init(void) | |||
357 | 356 | ||
358 | if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ | 357 | if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ |
359 | timeout = WATCHDOG_TIMEOUT; | 358 | timeout = WATCHDOG_TIMEOUT; |
360 | printk(KERN_INFO PFX | 359 | pr_info("timeout value must be 1 <= x <= 3600, using %d\n", |
361 | "timeout value must be 1 <= x <= 3600, using %d\n", | 360 | timeout); |
362 | timeout); | ||
363 | } | 361 | } |
364 | 362 | ||
365 | if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) { | 363 | if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) { |
366 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 364 | pr_err("I/O address 0x%04x already in use\n", |
367 | ENABLE_W83877F_PORT); | 365 | ENABLE_W83877F_PORT); |
368 | rc = -EIO; | 366 | rc = -EIO; |
369 | goto err_out; | 367 | goto err_out; |
370 | } | 368 | } |
371 | 369 | ||
372 | if (!request_region(WDT_PING, 1, "W8387FF WDT")) { | 370 | if (!request_region(WDT_PING, 1, "W8387FF WDT")) { |
373 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 371 | pr_err("I/O address 0x%04x already in use\n", WDT_PING); |
374 | WDT_PING); | ||
375 | rc = -EIO; | 372 | rc = -EIO; |
376 | goto err_out_region1; | 373 | goto err_out_region1; |
377 | } | 374 | } |
378 | 375 | ||
379 | rc = register_reboot_notifier(&wdt_notifier); | 376 | rc = register_reboot_notifier(&wdt_notifier); |
380 | if (rc) { | 377 | if (rc) { |
381 | printk(KERN_ERR PFX | 378 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
382 | "cannot register reboot notifier (err=%d)\n", rc); | ||
383 | goto err_out_region2; | 379 | goto err_out_region2; |
384 | } | 380 | } |
385 | 381 | ||
386 | rc = misc_register(&wdt_miscdev); | 382 | rc = misc_register(&wdt_miscdev); |
387 | if (rc) { | 383 | if (rc) { |
388 | printk(KERN_ERR PFX | 384 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
389 | "cannot register miscdev on minor=%d (err=%d)\n", | 385 | wdt_miscdev.minor, rc); |
390 | wdt_miscdev.minor, rc); | ||
391 | goto err_out_reboot; | 386 | goto err_out_reboot; |
392 | } | 387 | } |
393 | 388 | ||
394 | printk(KERN_INFO PFX | 389 | pr_info("WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n", |
395 | "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n", | ||
396 | timeout, nowayout); | 390 | timeout, nowayout); |
397 | 391 | ||
398 | return 0; | 392 | return 0; |
diff --git a/drivers/watchdog/w83977f_wdt.c b/drivers/watchdog/w83977f_wdt.c index 6e6743d1066f..d301b1bf1664 100644 --- a/drivers/watchdog/w83977f_wdt.c +++ b/drivers/watchdog/w83977f_wdt.c | |||
@@ -15,6 +15,8 @@ | |||
15 | * | 15 | * |
16 | */ | 16 | */ |
17 | 17 | ||
18 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
19 | |||
18 | #include <linux/module.h> | 20 | #include <linux/module.h> |
19 | #include <linux/moduleparam.h> | 21 | #include <linux/moduleparam.h> |
20 | #include <linux/types.h> | 22 | #include <linux/types.h> |
@@ -33,8 +35,6 @@ | |||
33 | 35 | ||
34 | #define WATCHDOG_VERSION "1.00" | 36 | #define WATCHDOG_VERSION "1.00" |
35 | #define WATCHDOG_NAME "W83977F WDT" | 37 | #define WATCHDOG_NAME "W83977F WDT" |
36 | #define PFX WATCHDOG_NAME ": " | ||
37 | #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" | ||
38 | 38 | ||
39 | #define IO_INDEX_PORT 0x3F0 | 39 | #define IO_INDEX_PORT 0x3F0 |
40 | #define IO_DATA_PORT (IO_INDEX_PORT+1) | 40 | #define IO_DATA_PORT (IO_INDEX_PORT+1) |
@@ -131,7 +131,7 @@ static int wdt_start(void) | |||
131 | 131 | ||
132 | spin_unlock_irqrestore(&spinlock, flags); | 132 | spin_unlock_irqrestore(&spinlock, flags); |
133 | 133 | ||
134 | printk(KERN_INFO PFX "activated.\n"); | 134 | pr_info("activated\n"); |
135 | 135 | ||
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
@@ -185,7 +185,7 @@ static int wdt_stop(void) | |||
185 | 185 | ||
186 | spin_unlock_irqrestore(&spinlock, flags); | 186 | spin_unlock_irqrestore(&spinlock, flags); |
187 | 187 | ||
188 | printk(KERN_INFO PFX "shutdown.\n"); | 188 | pr_info("shutdown\n"); |
189 | 189 | ||
190 | return 0; | 190 | return 0; |
191 | } | 191 | } |
@@ -313,8 +313,7 @@ static int wdt_release(struct inode *inode, struct file *file) | |||
313 | clear_bit(0, &timer_alive); | 313 | clear_bit(0, &timer_alive); |
314 | } else { | 314 | } else { |
315 | wdt_keepalive(); | 315 | wdt_keepalive(); |
316 | printk(KERN_CRIT PFX | 316 | pr_crit("unexpected close, not stopping watchdog!\n"); |
317 | "unexpected close, not stopping watchdog!\n"); | ||
318 | } | 317 | } |
319 | expect_close = 0; | 318 | expect_close = 0; |
320 | return 0; | 319 | return 0; |
@@ -471,7 +470,7 @@ static int __init w83977f_wdt_init(void) | |||
471 | { | 470 | { |
472 | int rc; | 471 | int rc; |
473 | 472 | ||
474 | printk(KERN_INFO PFX DRIVER_VERSION); | 473 | pr_info("driver v%s\n", WATCHDOG_VERSION); |
475 | 474 | ||
476 | /* | 475 | /* |
477 | * Check that the timeout value is within it's range; | 476 | * Check that the timeout value is within it's range; |
@@ -479,36 +478,31 @@ static int __init w83977f_wdt_init(void) | |||
479 | */ | 478 | */ |
480 | if (wdt_set_timeout(timeout)) { | 479 | if (wdt_set_timeout(timeout)) { |
481 | wdt_set_timeout(DEFAULT_TIMEOUT); | 480 | wdt_set_timeout(DEFAULT_TIMEOUT); |
482 | printk(KERN_INFO PFX | 481 | pr_info("timeout value must be 15 <= timeout <= 7635, using %d\n", |
483 | "timeout value must be 15 <= timeout <= 7635, using %d\n", | 482 | DEFAULT_TIMEOUT); |
484 | DEFAULT_TIMEOUT); | ||
485 | } | 483 | } |
486 | 484 | ||
487 | if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { | 485 | if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { |
488 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 486 | pr_err("I/O address 0x%04x already in use\n", IO_INDEX_PORT); |
489 | IO_INDEX_PORT); | ||
490 | rc = -EIO; | 487 | rc = -EIO; |
491 | goto err_out; | 488 | goto err_out; |
492 | } | 489 | } |
493 | 490 | ||
494 | rc = register_reboot_notifier(&wdt_notifier); | 491 | rc = register_reboot_notifier(&wdt_notifier); |
495 | if (rc) { | 492 | if (rc) { |
496 | printk(KERN_ERR PFX | 493 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
497 | "cannot register reboot notifier (err=%d)\n", rc); | ||
498 | goto err_out_region; | 494 | goto err_out_region; |
499 | } | 495 | } |
500 | 496 | ||
501 | rc = misc_register(&wdt_miscdev); | 497 | rc = misc_register(&wdt_miscdev); |
502 | if (rc) { | 498 | if (rc) { |
503 | printk(KERN_ERR PFX | 499 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
504 | "cannot register miscdev on minor=%d (err=%d)\n", | 500 | wdt_miscdev.minor, rc); |
505 | wdt_miscdev.minor, rc); | ||
506 | goto err_out_reboot; | 501 | goto err_out_reboot; |
507 | } | 502 | } |
508 | 503 | ||
509 | printk(KERN_INFO PFX | 504 | pr_info("initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", |
510 | "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", | 505 | timeout, nowayout, testmode); |
511 | timeout, nowayout, testmode); | ||
512 | 506 | ||
513 | return 0; | 507 | return 0; |
514 | 508 | ||
diff --git a/drivers/watchdog/wafer5823wdt.c b/drivers/watchdog/wafer5823wdt.c index c3c3188c34d7..1dea144017e5 100644 --- a/drivers/watchdog/wafer5823wdt.c +++ b/drivers/watchdog/wafer5823wdt.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/module.h> | 31 | #include <linux/module.h> |
30 | #include <linux/moduleparam.h> | 32 | #include <linux/moduleparam.h> |
31 | #include <linux/miscdevice.h> | 33 | #include <linux/miscdevice.h> |
@@ -203,8 +205,7 @@ static int wafwdt_close(struct inode *inode, struct file *file) | |||
203 | if (expect_close == 42) | 205 | if (expect_close == 42) |
204 | wafwdt_stop(); | 206 | wafwdt_stop(); |
205 | else { | 207 | else { |
206 | printk(KERN_CRIT PFX | 208 | pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); |
207 | "WDT device closed unexpectedly. WDT will not stop!\n"); | ||
208 | wafwdt_ping(); | 209 | wafwdt_ping(); |
209 | } | 210 | } |
210 | clear_bit(0, &wafwdt_is_open); | 211 | clear_bit(0, &wafwdt_is_open); |
@@ -256,49 +257,42 @@ static int __init wafwdt_init(void) | |||
256 | { | 257 | { |
257 | int ret; | 258 | int ret; |
258 | 259 | ||
259 | printk(KERN_INFO | 260 | pr_info("WDT driver for Wafer 5823 single board computer initialising\n"); |
260 | "WDT driver for Wafer 5823 single board computer initialising.\n"); | ||
261 | 261 | ||
262 | if (timeout < 1 || timeout > 255) { | 262 | if (timeout < 1 || timeout > 255) { |
263 | timeout = WD_TIMO; | 263 | timeout = WD_TIMO; |
264 | printk(KERN_INFO PFX | 264 | pr_info("timeout value must be 1 <= x <= 255, using %d\n", |
265 | "timeout value must be 1 <= x <= 255, using %d\n", | 265 | timeout); |
266 | timeout); | ||
267 | } | 266 | } |
268 | 267 | ||
269 | if (wdt_stop != wdt_start) { | 268 | if (wdt_stop != wdt_start) { |
270 | if (!request_region(wdt_stop, 1, "Wafer 5823 WDT")) { | 269 | if (!request_region(wdt_stop, 1, "Wafer 5823 WDT")) { |
271 | printk(KERN_ERR PFX | 270 | pr_err("I/O address 0x%04x already in use\n", wdt_stop); |
272 | "I/O address 0x%04x already in use\n", | ||
273 | wdt_stop); | ||
274 | ret = -EIO; | 271 | ret = -EIO; |
275 | goto error; | 272 | goto error; |
276 | } | 273 | } |
277 | } | 274 | } |
278 | 275 | ||
279 | if (!request_region(wdt_start, 1, "Wafer 5823 WDT")) { | 276 | if (!request_region(wdt_start, 1, "Wafer 5823 WDT")) { |
280 | printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", | 277 | pr_err("I/O address 0x%04x already in use\n", wdt_start); |
281 | wdt_start); | ||
282 | ret = -EIO; | 278 | ret = -EIO; |
283 | goto error2; | 279 | goto error2; |
284 | } | 280 | } |
285 | 281 | ||
286 | ret = register_reboot_notifier(&wafwdt_notifier); | 282 | ret = register_reboot_notifier(&wafwdt_notifier); |
287 | if (ret != 0) { | 283 | if (ret != 0) { |
288 | printk(KERN_ERR PFX | 284 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
289 | "cannot register reboot notifier (err=%d)\n", ret); | ||
290 | goto error3; | 285 | goto error3; |
291 | } | 286 | } |
292 | 287 | ||
293 | ret = misc_register(&wafwdt_miscdev); | 288 | ret = misc_register(&wafwdt_miscdev); |
294 | if (ret != 0) { | 289 | if (ret != 0) { |
295 | printk(KERN_ERR PFX | 290 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
296 | "cannot register miscdev on minor=%d (err=%d)\n", | 291 | WATCHDOG_MINOR, ret); |
297 | WATCHDOG_MINOR, ret); | ||
298 | goto error4; | 292 | goto error4; |
299 | } | 293 | } |
300 | 294 | ||
301 | printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", | 295 | pr_info("initialized. timeout=%d sec (nowayout=%d)\n", |
302 | timeout, nowayout); | 296 | timeout, nowayout); |
303 | 297 | ||
304 | return ret; | 298 | return ret; |
diff --git a/drivers/watchdog/watchdog_core.c b/drivers/watchdog/watchdog_core.c index cfa1a1518aad..14d768bfa267 100644 --- a/drivers/watchdog/watchdog_core.c +++ b/drivers/watchdog/watchdog_core.c | |||
@@ -77,7 +77,7 @@ int watchdog_register_device(struct watchdog_device *wdd) | |||
77 | /* We only support 1 watchdog device via the /dev/watchdog interface */ | 77 | /* We only support 1 watchdog device via the /dev/watchdog interface */ |
78 | ret = watchdog_dev_register(wdd); | 78 | ret = watchdog_dev_register(wdd); |
79 | if (ret) { | 79 | if (ret) { |
80 | pr_err("error registering /dev/watchdog (err=%d).\n", ret); | 80 | pr_err("error registering /dev/watchdog (err=%d)\n", ret); |
81 | return ret; | 81 | return ret; |
82 | } | 82 | } |
83 | 83 | ||
@@ -101,7 +101,7 @@ void watchdog_unregister_device(struct watchdog_device *wdd) | |||
101 | 101 | ||
102 | ret = watchdog_dev_unregister(wdd); | 102 | ret = watchdog_dev_unregister(wdd); |
103 | if (ret) | 103 | if (ret) |
104 | pr_err("error unregistering /dev/watchdog (err=%d).\n", ret); | 104 | pr_err("error unregistering /dev/watchdog (err=%d)\n", ret); |
105 | } | 105 | } |
106 | EXPORT_SYMBOL_GPL(watchdog_unregister_device); | 106 | EXPORT_SYMBOL_GPL(watchdog_unregister_device); |
107 | 107 | ||
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index 1199da0f98cf..55b1f60b19d2 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c | |||
@@ -347,7 +347,7 @@ int watchdog_dev_register(struct watchdog_device *watchdog) | |||
347 | 347 | ||
348 | /* Only one device can register for /dev/watchdog */ | 348 | /* Only one device can register for /dev/watchdog */ |
349 | if (test_and_set_bit(0, &watchdog_dev_busy)) { | 349 | if (test_and_set_bit(0, &watchdog_dev_busy)) { |
350 | pr_err("only one watchdog can use /dev/watchdog.\n"); | 350 | pr_err("only one watchdog can use /dev/watchdog\n"); |
351 | return -EBUSY; | 351 | return -EBUSY; |
352 | } | 352 | } |
353 | 353 | ||
@@ -355,8 +355,8 @@ int watchdog_dev_register(struct watchdog_device *watchdog) | |||
355 | 355 | ||
356 | err = misc_register(&watchdog_miscdev); | 356 | err = misc_register(&watchdog_miscdev); |
357 | if (err != 0) { | 357 | if (err != 0) { |
358 | pr_err("%s: cannot register miscdev on minor=%d (err=%d).\n", | 358 | pr_err("%s: cannot register miscdev on minor=%d (err=%d)\n", |
359 | watchdog->info->identity, WATCHDOG_MINOR, err); | 359 | watchdog->info->identity, WATCHDOG_MINOR, err); |
360 | goto out; | 360 | goto out; |
361 | } | 361 | } |
362 | 362 | ||
@@ -383,8 +383,8 @@ int watchdog_dev_unregister(struct watchdog_device *watchdog) | |||
383 | 383 | ||
384 | /* We can only unregister the watchdog device that was registered */ | 384 | /* We can only unregister the watchdog device that was registered */ |
385 | if (watchdog != wdd) { | 385 | if (watchdog != wdd) { |
386 | pr_err("%s: watchdog was not registered as /dev/watchdog.\n", | 386 | pr_err("%s: watchdog was not registered as /dev/watchdog\n", |
387 | watchdog->info->identity); | 387 | watchdog->info->identity); |
388 | return -ENODEV; | 388 | return -ENODEV; |
389 | } | 389 | } |
390 | 390 | ||
diff --git a/drivers/watchdog/wdrtas.c b/drivers/watchdog/wdrtas.c index 94ec22b9e66b..b7b34600f9a0 100644 --- a/drivers/watchdog/wdrtas.c +++ b/drivers/watchdog/wdrtas.c | |||
@@ -26,6 +26,8 @@ | |||
26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | 26 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
30 | |||
29 | #include <linux/fs.h> | 31 | #include <linux/fs.h> |
30 | #include <linux/init.h> | 32 | #include <linux/init.h> |
31 | #include <linux/kernel.h> | 33 | #include <linux/kernel.h> |
@@ -93,8 +95,8 @@ static int wdrtas_set_interval(int interval) | |||
93 | result = rtas_call(wdrtas_token_set_indicator, 3, 1, NULL, | 95 | result = rtas_call(wdrtas_token_set_indicator, 3, 1, NULL, |
94 | WDRTAS_SURVEILLANCE_IND, 0, interval); | 96 | WDRTAS_SURVEILLANCE_IND, 0, interval); |
95 | if (result < 0 && print_msg) { | 97 | if (result < 0 && print_msg) { |
96 | printk(KERN_ERR "wdrtas: setting the watchdog to %i " | 98 | pr_err("setting the watchdog to %i timeout failed: %li\n", |
97 | "timeout failed: %li\n", interval, result); | 99 | interval, result); |
98 | print_msg--; | 100 | print_msg--; |
99 | } | 101 | } |
100 | 102 | ||
@@ -128,8 +130,8 @@ static int wdrtas_get_interval(int fallback_value) | |||
128 | spin_unlock(&rtas_data_buf_lock); | 130 | spin_unlock(&rtas_data_buf_lock); |
129 | 131 | ||
130 | if (value[0] != 0 || value[1] != 2 || value[3] != 0 || result < 0) { | 132 | if (value[0] != 0 || value[1] != 2 || value[3] != 0 || result < 0) { |
131 | printk(KERN_WARNING "wdrtas: could not get sp_spi watchdog " | 133 | pr_warn("could not get sp_spi watchdog timeout (%li). Continuing\n", |
132 | "timeout (%li). Continuing\n", result); | 134 | result); |
133 | return fallback_value; | 135 | return fallback_value; |
134 | } | 136 | } |
135 | 137 | ||
@@ -170,18 +172,18 @@ static void wdrtas_log_scanned_event(void) | |||
170 | int i; | 172 | int i; |
171 | 173 | ||
172 | for (i = 0; i < WDRTAS_LOGBUFFER_LEN; i += 16) | 174 | for (i = 0; i < WDRTAS_LOGBUFFER_LEN; i += 16) |
173 | printk(KERN_INFO "wdrtas: dumping event (line %i/%i), data = " | 175 | pr_info("dumping event (line %i/%i), data = " |
174 | "%02x %02x %02x %02x %02x %02x %02x %02x " | 176 | "%02x %02x %02x %02x %02x %02x %02x %02x " |
175 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", | 177 | "%02x %02x %02x %02x %02x %02x %02x %02x\n", |
176 | (i / 16) + 1, (WDRTAS_LOGBUFFER_LEN / 16), | 178 | (i / 16) + 1, (WDRTAS_LOGBUFFER_LEN / 16), |
177 | wdrtas_logbuffer[i + 0], wdrtas_logbuffer[i + 1], | 179 | wdrtas_logbuffer[i + 0], wdrtas_logbuffer[i + 1], |
178 | wdrtas_logbuffer[i + 2], wdrtas_logbuffer[i + 3], | 180 | wdrtas_logbuffer[i + 2], wdrtas_logbuffer[i + 3], |
179 | wdrtas_logbuffer[i + 4], wdrtas_logbuffer[i + 5], | 181 | wdrtas_logbuffer[i + 4], wdrtas_logbuffer[i + 5], |
180 | wdrtas_logbuffer[i + 6], wdrtas_logbuffer[i + 7], | 182 | wdrtas_logbuffer[i + 6], wdrtas_logbuffer[i + 7], |
181 | wdrtas_logbuffer[i + 8], wdrtas_logbuffer[i + 9], | 183 | wdrtas_logbuffer[i + 8], wdrtas_logbuffer[i + 9], |
182 | wdrtas_logbuffer[i + 10], wdrtas_logbuffer[i + 11], | 184 | wdrtas_logbuffer[i + 10], wdrtas_logbuffer[i + 11], |
183 | wdrtas_logbuffer[i + 12], wdrtas_logbuffer[i + 13], | 185 | wdrtas_logbuffer[i + 12], wdrtas_logbuffer[i + 13], |
184 | wdrtas_logbuffer[i + 14], wdrtas_logbuffer[i + 15]); | 186 | wdrtas_logbuffer[i + 14], wdrtas_logbuffer[i + 15]); |
185 | } | 187 | } |
186 | 188 | ||
187 | /** | 189 | /** |
@@ -201,8 +203,7 @@ static void wdrtas_timer_keepalive(void) | |||
201 | (void *)__pa(wdrtas_logbuffer), | 203 | (void *)__pa(wdrtas_logbuffer), |
202 | WDRTAS_LOGBUFFER_LEN); | 204 | WDRTAS_LOGBUFFER_LEN); |
203 | if (result < 0) | 205 | if (result < 0) |
204 | printk(KERN_ERR "wdrtas: event-scan failed: %li\n", | 206 | pr_err("event-scan failed: %li\n", result); |
205 | result); | ||
206 | if (result == 0) | 207 | if (result == 0) |
207 | wdrtas_log_scanned_event(); | 208 | wdrtas_log_scanned_event(); |
208 | } while (result == 0); | 209 | } while (result == 0); |
@@ -224,8 +225,7 @@ static int wdrtas_get_temperature(void) | |||
224 | result = rtas_get_sensor(WDRTAS_THERMAL_SENSOR, 0, &temperature); | 225 | result = rtas_get_sensor(WDRTAS_THERMAL_SENSOR, 0, &temperature); |
225 | 226 | ||
226 | if (result < 0) | 227 | if (result < 0) |
227 | printk(KERN_WARNING "wdrtas: reading the thermal sensor " | 228 | pr_warn("reading the thermal sensor failed: %i\n", result); |
228 | "failed: %i\n", result); | ||
229 | else | 229 | else |
230 | temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */ | 230 | temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */ |
231 | 231 | ||
@@ -419,8 +419,7 @@ static int wdrtas_close(struct inode *inode, struct file *file) | |||
419 | if (wdrtas_expect_close == WDRTAS_MAGIC_CHAR) | 419 | if (wdrtas_expect_close == WDRTAS_MAGIC_CHAR) |
420 | wdrtas_timer_stop(); | 420 | wdrtas_timer_stop(); |
421 | else { | 421 | else { |
422 | printk(KERN_WARNING "wdrtas: got unexpected close. Watchdog " | 422 | pr_warn("got unexpected close. Watchdog not stopped.\n"); |
423 | "not stopped.\n"); | ||
424 | wdrtas_timer_keepalive(); | 423 | wdrtas_timer_keepalive(); |
425 | } | 424 | } |
426 | 425 | ||
@@ -552,30 +551,24 @@ static int wdrtas_get_tokens(void) | |||
552 | { | 551 | { |
553 | wdrtas_token_get_sensor_state = rtas_token("get-sensor-state"); | 552 | wdrtas_token_get_sensor_state = rtas_token("get-sensor-state"); |
554 | if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE) { | 553 | if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE) { |
555 | printk(KERN_WARNING "wdrtas: couldn't get token for " | 554 | pr_warn("couldn't get token for get-sensor-state. Trying to continue without temperature support.\n"); |
556 | "get-sensor-state. Trying to continue without " | ||
557 | "temperature support.\n"); | ||
558 | } | 555 | } |
559 | 556 | ||
560 | wdrtas_token_get_sp = rtas_token("ibm,get-system-parameter"); | 557 | wdrtas_token_get_sp = rtas_token("ibm,get-system-parameter"); |
561 | if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE) { | 558 | if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE) { |
562 | printk(KERN_WARNING "wdrtas: couldn't get token for " | 559 | pr_warn("couldn't get token for ibm,get-system-parameter. Trying to continue with a default timeout value of %i seconds.\n", |
563 | "ibm,get-system-parameter. Trying to continue with " | 560 | WDRTAS_DEFAULT_INTERVAL); |
564 | "a default timeout value of %i seconds.\n", | ||
565 | WDRTAS_DEFAULT_INTERVAL); | ||
566 | } | 561 | } |
567 | 562 | ||
568 | wdrtas_token_set_indicator = rtas_token("set-indicator"); | 563 | wdrtas_token_set_indicator = rtas_token("set-indicator"); |
569 | if (wdrtas_token_set_indicator == RTAS_UNKNOWN_SERVICE) { | 564 | if (wdrtas_token_set_indicator == RTAS_UNKNOWN_SERVICE) { |
570 | printk(KERN_ERR "wdrtas: couldn't get token for " | 565 | pr_err("couldn't get token for set-indicator. Terminating watchdog code.\n"); |
571 | "set-indicator. Terminating watchdog code.\n"); | ||
572 | return -EIO; | 566 | return -EIO; |
573 | } | 567 | } |
574 | 568 | ||
575 | wdrtas_token_event_scan = rtas_token("event-scan"); | 569 | wdrtas_token_event_scan = rtas_token("event-scan"); |
576 | if (wdrtas_token_event_scan == RTAS_UNKNOWN_SERVICE) { | 570 | if (wdrtas_token_event_scan == RTAS_UNKNOWN_SERVICE) { |
577 | printk(KERN_ERR "wdrtas: couldn't get token for event-scan. " | 571 | pr_err("couldn't get token for event-scan. Terminating watchdog code.\n"); |
578 | "Terminating watchdog code.\n"); | ||
579 | return -EIO; | 572 | return -EIO; |
580 | } | 573 | } |
581 | 574 | ||
@@ -609,17 +602,14 @@ static int wdrtas_register_devs(void) | |||
609 | 602 | ||
610 | result = misc_register(&wdrtas_miscdev); | 603 | result = misc_register(&wdrtas_miscdev); |
611 | if (result) { | 604 | if (result) { |
612 | printk(KERN_ERR "wdrtas: couldn't register watchdog misc " | 605 | pr_err("couldn't register watchdog misc device. Terminating watchdog code.\n"); |
613 | "device. Terminating watchdog code.\n"); | ||
614 | return result; | 606 | return result; |
615 | } | 607 | } |
616 | 608 | ||
617 | if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE) { | 609 | if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE) { |
618 | result = misc_register(&wdrtas_tempdev); | 610 | result = misc_register(&wdrtas_tempdev); |
619 | if (result) { | 611 | if (result) { |
620 | printk(KERN_WARNING "wdrtas: couldn't register " | 612 | pr_warn("couldn't register watchdog temperature misc device. Continuing without temperature support.\n"); |
621 | "watchdog temperature misc device. Continuing " | ||
622 | "without temperature support.\n"); | ||
623 | wdrtas_token_get_sensor_state = RTAS_UNKNOWN_SERVICE; | 613 | wdrtas_token_get_sensor_state = RTAS_UNKNOWN_SERVICE; |
624 | } | 614 | } |
625 | } | 615 | } |
@@ -643,8 +633,7 @@ static int __init wdrtas_init(void) | |||
643 | return -ENODEV; | 633 | return -ENODEV; |
644 | 634 | ||
645 | if (register_reboot_notifier(&wdrtas_notifier)) { | 635 | if (register_reboot_notifier(&wdrtas_notifier)) { |
646 | printk(KERN_ERR "wdrtas: could not register reboot notifier. " | 636 | pr_err("could not register reboot notifier. Terminating watchdog code.\n"); |
647 | "Terminating watchdog code.\n"); | ||
648 | wdrtas_unregister_devs(); | 637 | wdrtas_unregister_devs(); |
649 | return -ENODEV; | 638 | return -ENODEV; |
650 | } | 639 | } |
diff --git a/drivers/watchdog/wdt.c b/drivers/watchdog/wdt.c index d2ef002be96b..4ef6702fff82 100644 --- a/drivers/watchdog/wdt.c +++ b/drivers/watchdog/wdt.c | |||
@@ -32,6 +32,8 @@ | |||
32 | * Matt Domsch : Added nowayout module option | 32 | * Matt Domsch : Added nowayout module option |
33 | */ | 33 | */ |
34 | 34 | ||
35 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
36 | |||
35 | #include <linux/interrupt.h> | 37 | #include <linux/interrupt.h> |
36 | #include <linux/module.h> | 38 | #include <linux/module.h> |
37 | #include <linux/moduleparam.h> | 39 | #include <linux/moduleparam.h> |
@@ -252,11 +254,11 @@ static int wdt_get_temperature(void) | |||
252 | static void wdt_decode_501(int status) | 254 | static void wdt_decode_501(int status) |
253 | { | 255 | { |
254 | if (!(status & WDC_SR_TGOOD)) | 256 | if (!(status & WDC_SR_TGOOD)) |
255 | printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT)); | 257 | pr_crit("Overheat alarm (%d)\n", inb_p(WDT_RT)); |
256 | if (!(status & WDC_SR_PSUOVER)) | 258 | if (!(status & WDC_SR_PSUOVER)) |
257 | printk(KERN_CRIT "PSU over voltage.\n"); | 259 | pr_crit("PSU over voltage\n"); |
258 | if (!(status & WDC_SR_PSUUNDR)) | 260 | if (!(status & WDC_SR_PSUUNDR)) |
259 | printk(KERN_CRIT "PSU under voltage.\n"); | 261 | pr_crit("PSU under voltage\n"); |
260 | } | 262 | } |
261 | 263 | ||
262 | /** | 264 | /** |
@@ -280,25 +282,25 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id) | |||
280 | spin_lock(&wdt_lock); | 282 | spin_lock(&wdt_lock); |
281 | status = inb_p(WDT_SR); | 283 | status = inb_p(WDT_SR); |
282 | 284 | ||
283 | printk(KERN_CRIT "WDT status %d\n", status); | 285 | pr_crit("WDT status %d\n", status); |
284 | 286 | ||
285 | if (type == 501) { | 287 | if (type == 501) { |
286 | wdt_decode_501(status); | 288 | wdt_decode_501(status); |
287 | if (tachometer) { | 289 | if (tachometer) { |
288 | if (!(status & WDC_SR_FANGOOD)) | 290 | if (!(status & WDC_SR_FANGOOD)) |
289 | printk(KERN_CRIT "Possible fan fault.\n"); | 291 | pr_crit("Possible fan fault\n"); |
290 | } | 292 | } |
291 | } | 293 | } |
292 | if (!(status & WDC_SR_WCCR)) { | 294 | if (!(status & WDC_SR_WCCR)) { |
293 | #ifdef SOFTWARE_REBOOT | 295 | #ifdef SOFTWARE_REBOOT |
294 | #ifdef ONLY_TESTING | 296 | #ifdef ONLY_TESTING |
295 | printk(KERN_CRIT "Would Reboot.\n"); | 297 | pr_crit("Would Reboot\n"); |
296 | #else | 298 | #else |
297 | printk(KERN_CRIT "Initiating system reboot.\n"); | 299 | pr_crit("Initiating system reboot\n"); |
298 | emergency_restart(); | 300 | emergency_restart(); |
299 | #endif | 301 | #endif |
300 | #else | 302 | #else |
301 | printk(KERN_CRIT "Reset in 5ms.\n"); | 303 | pr_crit("Reset in 5ms\n"); |
302 | #endif | 304 | #endif |
303 | } | 305 | } |
304 | spin_unlock(&wdt_lock); | 306 | spin_unlock(&wdt_lock); |
@@ -441,8 +443,7 @@ static int wdt_release(struct inode *inode, struct file *file) | |||
441 | wdt_stop(); | 443 | wdt_stop(); |
442 | clear_bit(0, &wdt_is_open); | 444 | clear_bit(0, &wdt_is_open); |
443 | } else { | 445 | } else { |
444 | printk(KERN_CRIT | 446 | pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); |
445 | "wdt: WDT device closed unexpectedly. WDT will not stop!\n"); | ||
446 | wdt_ping(); | 447 | wdt_ping(); |
447 | } | 448 | } |
448 | expect_close = 0; | 449 | expect_close = 0; |
@@ -593,7 +594,7 @@ static int __init wdt_init(void) | |||
593 | int ret; | 594 | int ret; |
594 | 595 | ||
595 | if (type != 500 && type != 501) { | 596 | if (type != 500 && type != 501) { |
596 | printk(KERN_ERR "wdt: unknown card type '%d'.\n", type); | 597 | pr_err("unknown card type '%d'\n", type); |
597 | return -ENODEV; | 598 | return -ENODEV; |
598 | } | 599 | } |
599 | 600 | ||
@@ -601,53 +602,49 @@ static int __init wdt_init(void) | |||
601 | if not reset to the default */ | 602 | if not reset to the default */ |
602 | if (wdt_set_heartbeat(heartbeat)) { | 603 | if (wdt_set_heartbeat(heartbeat)) { |
603 | wdt_set_heartbeat(WD_TIMO); | 604 | wdt_set_heartbeat(WD_TIMO); |
604 | printk(KERN_INFO "wdt: heartbeat value must be " | 605 | pr_info("heartbeat value must be 0 < heartbeat < 65536, using %d\n", |
605 | "0 < heartbeat < 65536, using %d\n", WD_TIMO); | 606 | WD_TIMO); |
606 | } | 607 | } |
607 | 608 | ||
608 | if (!request_region(io, 8, "wdt501p")) { | 609 | if (!request_region(io, 8, "wdt501p")) { |
609 | printk(KERN_ERR | 610 | pr_err("I/O address 0x%04x already in use\n", io); |
610 | "wdt: I/O address 0x%04x already in use\n", io); | ||
611 | ret = -EBUSY; | 611 | ret = -EBUSY; |
612 | goto out; | 612 | goto out; |
613 | } | 613 | } |
614 | 614 | ||
615 | ret = request_irq(irq, wdt_interrupt, 0, "wdt501p", NULL); | 615 | ret = request_irq(irq, wdt_interrupt, 0, "wdt501p", NULL); |
616 | if (ret) { | 616 | if (ret) { |
617 | printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq); | 617 | pr_err("IRQ %d is not free\n", irq); |
618 | goto outreg; | 618 | goto outreg; |
619 | } | 619 | } |
620 | 620 | ||
621 | ret = register_reboot_notifier(&wdt_notifier); | 621 | ret = register_reboot_notifier(&wdt_notifier); |
622 | if (ret) { | 622 | if (ret) { |
623 | printk(KERN_ERR | 623 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
624 | "wdt: cannot register reboot notifier (err=%d)\n", ret); | ||
625 | goto outirq; | 624 | goto outirq; |
626 | } | 625 | } |
627 | 626 | ||
628 | if (type == 501) { | 627 | if (type == 501) { |
629 | ret = misc_register(&temp_miscdev); | 628 | ret = misc_register(&temp_miscdev); |
630 | if (ret) { | 629 | if (ret) { |
631 | printk(KERN_ERR "wdt: cannot register miscdev " | 630 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
632 | "on minor=%d (err=%d)\n", TEMP_MINOR, ret); | 631 | TEMP_MINOR, ret); |
633 | goto outrbt; | 632 | goto outrbt; |
634 | } | 633 | } |
635 | } | 634 | } |
636 | 635 | ||
637 | ret = misc_register(&wdt_miscdev); | 636 | ret = misc_register(&wdt_miscdev); |
638 | if (ret) { | 637 | if (ret) { |
639 | printk(KERN_ERR | 638 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
640 | "wdt: cannot register miscdev on minor=%d (err=%d)\n", | 639 | WATCHDOG_MINOR, ret); |
641 | WATCHDOG_MINOR, ret); | ||
642 | goto outmisc; | 640 | goto outmisc; |
643 | } | 641 | } |
644 | 642 | ||
645 | printk(KERN_INFO "WDT500/501-P driver 0.10 " | 643 | pr_info("WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", |
646 | "at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", | ||
647 | io, irq, heartbeat, nowayout); | 644 | io, irq, heartbeat, nowayout); |
648 | if (type == 501) | 645 | if (type == 501) |
649 | printk(KERN_INFO "wdt: Fan Tachometer is %s\n", | 646 | pr_info("Fan Tachometer is %s\n", |
650 | (tachometer ? "Enabled" : "Disabled")); | 647 | tachometer ? "Enabled" : "Disabled"); |
651 | return 0; | 648 | return 0; |
652 | 649 | ||
653 | outmisc: | 650 | outmisc: |
diff --git a/drivers/watchdog/wdt285.c b/drivers/watchdog/wdt285.c index f55135662d78..3daa330ae436 100644 --- a/drivers/watchdog/wdt285.c +++ b/drivers/watchdog/wdt285.c | |||
@@ -16,6 +16,8 @@ | |||
16 | * | 16 | * |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
20 | |||
19 | #include <linux/module.h> | 21 | #include <linux/module.h> |
20 | #include <linux/moduleparam.h> | 22 | #include <linux/moduleparam.h> |
21 | #include <linux/types.h> | 23 | #include <linux/types.h> |
@@ -49,7 +51,7 @@ static unsigned long timer_alive; | |||
49 | */ | 51 | */ |
50 | static void watchdog_fire(int irq, void *dev_id) | 52 | static void watchdog_fire(int irq, void *dev_id) |
51 | { | 53 | { |
52 | printk(KERN_CRIT "Watchdog: Would Reboot.\n"); | 54 | pr_crit("Would Reboot\n"); |
53 | *CSR_TIMER4_CNTL = 0; | 55 | *CSR_TIMER4_CNTL = 0; |
54 | *CSR_TIMER4_CLR = 0; | 56 | *CSR_TIMER4_CLR = 0; |
55 | } | 57 | } |
@@ -205,13 +207,11 @@ static int __init footbridge_watchdog_init(void) | |||
205 | if (retval < 0) | 207 | if (retval < 0) |
206 | return retval; | 208 | return retval; |
207 | 209 | ||
208 | printk(KERN_INFO | 210 | pr_info("Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n", |
209 | "Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n", | 211 | soft_margin); |
210 | soft_margin); | ||
211 | 212 | ||
212 | if (machine_is_cats()) | 213 | if (machine_is_cats()) |
213 | printk(KERN_WARNING | 214 | pr_warn("Warning: Watchdog reset may not work on this machine\n"); |
214 | "Warning: Watchdog reset may not work on this machine.\n"); | ||
215 | return 0; | 215 | return 0; |
216 | } | 216 | } |
217 | 217 | ||
diff --git a/drivers/watchdog/wdt977.c b/drivers/watchdog/wdt977.c index a2f01c9f5c34..cfb0a8cd7f12 100644 --- a/drivers/watchdog/wdt977.c +++ b/drivers/watchdog/wdt977.c | |||
@@ -23,6 +23,8 @@ | |||
23 | * Netwinders only | 23 | * Netwinders only |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
27 | |||
26 | #include <linux/module.h> | 28 | #include <linux/module.h> |
27 | #include <linux/moduleparam.h> | 29 | #include <linux/moduleparam.h> |
28 | #include <linux/types.h> | 30 | #include <linux/types.h> |
@@ -42,8 +44,6 @@ | |||
42 | 44 | ||
43 | #define WATCHDOG_VERSION "0.04" | 45 | #define WATCHDOG_VERSION "0.04" |
44 | #define WATCHDOG_NAME "Wdt977" | 46 | #define WATCHDOG_NAME "Wdt977" |
45 | #define PFX WATCHDOG_NAME ": " | ||
46 | #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" | ||
47 | 47 | ||
48 | #define IO_INDEX_PORT 0x370 /* on some systems it can be 0x3F0 */ | 48 | #define IO_INDEX_PORT 0x370 /* on some systems it can be 0x3F0 */ |
49 | #define IO_DATA_PORT (IO_INDEX_PORT + 1) | 49 | #define IO_DATA_PORT (IO_INDEX_PORT + 1) |
@@ -119,7 +119,7 @@ static int wdt977_start(void) | |||
119 | outb_p(LOCK_DATA, IO_INDEX_PORT); | 119 | outb_p(LOCK_DATA, IO_INDEX_PORT); |
120 | 120 | ||
121 | spin_unlock_irqrestore(&spinlock, flags); | 121 | spin_unlock_irqrestore(&spinlock, flags); |
122 | printk(KERN_INFO PFX "activated.\n"); | 122 | pr_info("activated\n"); |
123 | 123 | ||
124 | return 0; | 124 | return 0; |
125 | } | 125 | } |
@@ -164,7 +164,7 @@ static int wdt977_stop(void) | |||
164 | outb_p(LOCK_DATA, IO_INDEX_PORT); | 164 | outb_p(LOCK_DATA, IO_INDEX_PORT); |
165 | 165 | ||
166 | spin_unlock_irqrestore(&spinlock, flags); | 166 | spin_unlock_irqrestore(&spinlock, flags); |
167 | printk(KERN_INFO PFX "shutdown.\n"); | 167 | pr_info("shutdown\n"); |
168 | 168 | ||
169 | return 0; | 169 | return 0; |
170 | } | 170 | } |
@@ -288,8 +288,7 @@ static int wdt977_release(struct inode *inode, struct file *file) | |||
288 | clear_bit(0, &timer_alive); | 288 | clear_bit(0, &timer_alive); |
289 | } else { | 289 | } else { |
290 | wdt977_keepalive(); | 290 | wdt977_keepalive(); |
291 | printk(KERN_CRIT PFX | 291 | pr_crit("Unexpected close, not stopping watchdog!\n"); |
292 | "Unexpected close, not stopping watchdog!\n"); | ||
293 | } | 292 | } |
294 | expect_close = 0; | 293 | expect_close = 0; |
295 | return 0; | 294 | return 0; |
@@ -446,15 +445,14 @@ static int __init wd977_init(void) | |||
446 | { | 445 | { |
447 | int rc; | 446 | int rc; |
448 | 447 | ||
449 | printk(KERN_INFO PFX DRIVER_VERSION); | 448 | pr_info("driver v%s\n", WATCHDOG_VERSION); |
450 | 449 | ||
451 | /* Check that the timeout value is within its range; | 450 | /* Check that the timeout value is within its range; |
452 | if not reset to the default */ | 451 | if not reset to the default */ |
453 | if (wdt977_set_timeout(timeout)) { | 452 | if (wdt977_set_timeout(timeout)) { |
454 | wdt977_set_timeout(DEFAULT_TIMEOUT); | 453 | wdt977_set_timeout(DEFAULT_TIMEOUT); |
455 | printk(KERN_INFO PFX | 454 | pr_info("timeout value must be 60 < timeout < 15300, using %d\n", |
456 | "timeout value must be 60 < timeout < 15300, using %d\n", | 455 | DEFAULT_TIMEOUT); |
457 | DEFAULT_TIMEOUT); | ||
458 | } | 456 | } |
459 | 457 | ||
460 | /* on Netwinder the IOports are already reserved by | 458 | /* on Netwinder the IOports are already reserved by |
@@ -462,9 +460,8 @@ static int __init wd977_init(void) | |||
462 | */ | 460 | */ |
463 | if (!machine_is_netwinder()) { | 461 | if (!machine_is_netwinder()) { |
464 | if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { | 462 | if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { |
465 | printk(KERN_ERR PFX | 463 | pr_err("I/O address 0x%04x already in use\n", |
466 | "I/O address 0x%04x already in use\n", | 464 | IO_INDEX_PORT); |
467 | IO_INDEX_PORT); | ||
468 | rc = -EIO; | 465 | rc = -EIO; |
469 | goto err_out; | 466 | goto err_out; |
470 | } | 467 | } |
@@ -472,22 +469,19 @@ static int __init wd977_init(void) | |||
472 | 469 | ||
473 | rc = register_reboot_notifier(&wdt977_notifier); | 470 | rc = register_reboot_notifier(&wdt977_notifier); |
474 | if (rc) { | 471 | if (rc) { |
475 | printk(KERN_ERR PFX | 472 | pr_err("cannot register reboot notifier (err=%d)\n", rc); |
476 | "cannot register reboot notifier (err=%d)\n", rc); | ||
477 | goto err_out_region; | 473 | goto err_out_region; |
478 | } | 474 | } |
479 | 475 | ||
480 | rc = misc_register(&wdt977_miscdev); | 476 | rc = misc_register(&wdt977_miscdev); |
481 | if (rc) { | 477 | if (rc) { |
482 | printk(KERN_ERR PFX | 478 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
483 | "cannot register miscdev on minor=%d (err=%d)\n", | 479 | wdt977_miscdev.minor, rc); |
484 | wdt977_miscdev.minor, rc); | ||
485 | goto err_out_reboot; | 480 | goto err_out_reboot; |
486 | } | 481 | } |
487 | 482 | ||
488 | printk(KERN_INFO PFX | 483 | pr_info("initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n", |
489 | "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n", | 484 | timeout, nowayout, testmode); |
490 | timeout, nowayout, testmode); | ||
491 | 485 | ||
492 | return 0; | 486 | return 0; |
493 | 487 | ||
diff --git a/drivers/watchdog/wdt_pci.c b/drivers/watchdog/wdt_pci.c index e0fc3baa9197..c099b6fcdf40 100644 --- a/drivers/watchdog/wdt_pci.c +++ b/drivers/watchdog/wdt_pci.c | |||
@@ -37,6 +37,8 @@ | |||
37 | * Matt Domsch : nowayout module option | 37 | * Matt Domsch : nowayout module option |
38 | */ | 38 | */ |
39 | 39 | ||
40 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
41 | |||
40 | #include <linux/interrupt.h> | 42 | #include <linux/interrupt.h> |
41 | #include <linux/module.h> | 43 | #include <linux/module.h> |
42 | #include <linux/moduleparam.h> | 44 | #include <linux/moduleparam.h> |
@@ -58,8 +60,6 @@ | |||
58 | #define WDT_IS_PCI | 60 | #define WDT_IS_PCI |
59 | #include "wd501p.h" | 61 | #include "wd501p.h" |
60 | 62 | ||
61 | #define PFX "wdt_pci: " | ||
62 | |||
63 | /* We can only use 1 card due to the /dev/watchdog restriction */ | 63 | /* We can only use 1 card due to the /dev/watchdog restriction */ |
64 | static int dev_count; | 64 | static int dev_count; |
65 | 65 | ||
@@ -312,33 +312,32 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id) | |||
312 | status = inb(WDT_SR); | 312 | status = inb(WDT_SR); |
313 | udelay(8); | 313 | udelay(8); |
314 | 314 | ||
315 | printk(KERN_CRIT PFX "status %d\n", status); | 315 | pr_crit("status %d\n", status); |
316 | 316 | ||
317 | if (type == 501) { | 317 | if (type == 501) { |
318 | if (!(status & WDC_SR_TGOOD)) { | 318 | if (!(status & WDC_SR_TGOOD)) { |
319 | printk(KERN_CRIT PFX "Overheat alarm.(%d)\n", | 319 | pr_crit("Overheat alarm (%d)\n", inb(WDT_RT)); |
320 | inb(WDT_RT)); | ||
321 | udelay(8); | 320 | udelay(8); |
322 | } | 321 | } |
323 | if (!(status & WDC_SR_PSUOVER)) | 322 | if (!(status & WDC_SR_PSUOVER)) |
324 | printk(KERN_CRIT PFX "PSU over voltage.\n"); | 323 | pr_crit("PSU over voltage\n"); |
325 | if (!(status & WDC_SR_PSUUNDR)) | 324 | if (!(status & WDC_SR_PSUUNDR)) |
326 | printk(KERN_CRIT PFX "PSU under voltage.\n"); | 325 | pr_crit("PSU under voltage\n"); |
327 | if (tachometer) { | 326 | if (tachometer) { |
328 | if (!(status & WDC_SR_FANGOOD)) | 327 | if (!(status & WDC_SR_FANGOOD)) |
329 | printk(KERN_CRIT PFX "Possible fan fault.\n"); | 328 | pr_crit("Possible fan fault\n"); |
330 | } | 329 | } |
331 | } | 330 | } |
332 | if (!(status & WDC_SR_WCCR)) { | 331 | if (!(status & WDC_SR_WCCR)) { |
333 | #ifdef SOFTWARE_REBOOT | 332 | #ifdef SOFTWARE_REBOOT |
334 | #ifdef ONLY_TESTING | 333 | #ifdef ONLY_TESTING |
335 | printk(KERN_CRIT PFX "Would Reboot.\n"); | 334 | pr_crit("Would Reboot\n"); |
336 | #else | 335 | #else |
337 | printk(KERN_CRIT PFX "Initiating system reboot.\n"); | 336 | pr_crit("Initiating system reboot\n"); |
338 | emergency_restart(NULL); | 337 | emergency_restart(NULL); |
339 | #endif | 338 | #endif |
340 | #else | 339 | #else |
341 | printk(KERN_CRIT PFX "Reset in 5ms.\n"); | 340 | pr_crit("Reset in 5ms\n"); |
342 | #endif | 341 | #endif |
343 | } | 342 | } |
344 | spin_unlock(&wdtpci_lock); | 343 | spin_unlock(&wdtpci_lock); |
@@ -484,7 +483,7 @@ static int wdtpci_release(struct inode *inode, struct file *file) | |||
484 | if (expect_close == 42) { | 483 | if (expect_close == 42) { |
485 | wdtpci_stop(); | 484 | wdtpci_stop(); |
486 | } else { | 485 | } else { |
487 | printk(KERN_CRIT PFX "Unexpected close, not stopping timer!"); | 486 | pr_crit("Unexpected close, not stopping timer!\n"); |
488 | wdtpci_ping(); | 487 | wdtpci_ping(); |
489 | } | 488 | } |
490 | expect_close = 0; | 489 | expect_close = 0; |
@@ -614,29 +613,29 @@ static int __devinit wdtpci_init_one(struct pci_dev *dev, | |||
614 | 613 | ||
615 | dev_count++; | 614 | dev_count++; |
616 | if (dev_count > 1) { | 615 | if (dev_count > 1) { |
617 | printk(KERN_ERR PFX "This driver only supports one device\n"); | 616 | pr_err("This driver only supports one device\n"); |
618 | return -ENODEV; | 617 | return -ENODEV; |
619 | } | 618 | } |
620 | 619 | ||
621 | if (type != 500 && type != 501) { | 620 | if (type != 500 && type != 501) { |
622 | printk(KERN_ERR PFX "unknown card type '%d'.\n", type); | 621 | pr_err("unknown card type '%d'\n", type); |
623 | return -ENODEV; | 622 | return -ENODEV; |
624 | } | 623 | } |
625 | 624 | ||
626 | if (pci_enable_device(dev)) { | 625 | if (pci_enable_device(dev)) { |
627 | printk(KERN_ERR PFX "Not possible to enable PCI Device\n"); | 626 | pr_err("Not possible to enable PCI Device\n"); |
628 | return -ENODEV; | 627 | return -ENODEV; |
629 | } | 628 | } |
630 | 629 | ||
631 | if (pci_resource_start(dev, 2) == 0x0000) { | 630 | if (pci_resource_start(dev, 2) == 0x0000) { |
632 | printk(KERN_ERR PFX "No I/O-Address for card detected\n"); | 631 | pr_err("No I/O-Address for card detected\n"); |
633 | ret = -ENODEV; | 632 | ret = -ENODEV; |
634 | goto out_pci; | 633 | goto out_pci; |
635 | } | 634 | } |
636 | 635 | ||
637 | if (pci_request_region(dev, 2, "wdt_pci")) { | 636 | if (pci_request_region(dev, 2, "wdt_pci")) { |
638 | printk(KERN_ERR PFX "I/O address 0x%llx already in use\n", | 637 | pr_err("I/O address 0x%llx already in use\n", |
639 | (unsigned long long)pci_resource_start(dev, 2)); | 638 | (unsigned long long)pci_resource_start(dev, 2)); |
640 | goto out_pci; | 639 | goto out_pci; |
641 | } | 640 | } |
642 | 641 | ||
@@ -645,53 +644,48 @@ static int __devinit wdtpci_init_one(struct pci_dev *dev, | |||
645 | 644 | ||
646 | if (request_irq(irq, wdtpci_interrupt, IRQF_SHARED, | 645 | if (request_irq(irq, wdtpci_interrupt, IRQF_SHARED, |
647 | "wdt_pci", &wdtpci_miscdev)) { | 646 | "wdt_pci", &wdtpci_miscdev)) { |
648 | printk(KERN_ERR PFX "IRQ %d is not free\n", irq); | 647 | pr_err("IRQ %d is not free\n", irq); |
649 | goto out_reg; | 648 | goto out_reg; |
650 | } | 649 | } |
651 | 650 | ||
652 | printk(KERN_INFO | 651 | pr_info("PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%llx (Interrupt %d)\n", |
653 | "PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%llx (Interrupt %d)\n", | 652 | (unsigned long long)io, irq); |
654 | (unsigned long long)io, irq); | ||
655 | 653 | ||
656 | /* Check that the heartbeat value is within its range; | 654 | /* Check that the heartbeat value is within its range; |
657 | if not reset to the default */ | 655 | if not reset to the default */ |
658 | if (wdtpci_set_heartbeat(heartbeat)) { | 656 | if (wdtpci_set_heartbeat(heartbeat)) { |
659 | wdtpci_set_heartbeat(WD_TIMO); | 657 | wdtpci_set_heartbeat(WD_TIMO); |
660 | printk(KERN_INFO PFX | 658 | pr_info("heartbeat value must be 0 < heartbeat < 65536, using %d\n", |
661 | "heartbeat value must be 0 < heartbeat < 65536, using %d\n", | 659 | WD_TIMO); |
662 | WD_TIMO); | ||
663 | } | 660 | } |
664 | 661 | ||
665 | ret = register_reboot_notifier(&wdtpci_notifier); | 662 | ret = register_reboot_notifier(&wdtpci_notifier); |
666 | if (ret) { | 663 | if (ret) { |
667 | printk(KERN_ERR PFX | 664 | pr_err("cannot register reboot notifier (err=%d)\n", ret); |
668 | "cannot register reboot notifier (err=%d)\n", ret); | ||
669 | goto out_irq; | 665 | goto out_irq; |
670 | } | 666 | } |
671 | 667 | ||
672 | if (type == 501) { | 668 | if (type == 501) { |
673 | ret = misc_register(&temp_miscdev); | 669 | ret = misc_register(&temp_miscdev); |
674 | if (ret) { | 670 | if (ret) { |
675 | printk(KERN_ERR PFX | 671 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
676 | "cannot register miscdev on minor=%d (err=%d)\n", | 672 | TEMP_MINOR, ret); |
677 | TEMP_MINOR, ret); | ||
678 | goto out_rbt; | 673 | goto out_rbt; |
679 | } | 674 | } |
680 | } | 675 | } |
681 | 676 | ||
682 | ret = misc_register(&wdtpci_miscdev); | 677 | ret = misc_register(&wdtpci_miscdev); |
683 | if (ret) { | 678 | if (ret) { |
684 | printk(KERN_ERR PFX | 679 | pr_err("cannot register miscdev on minor=%d (err=%d)\n", |
685 | "cannot register miscdev on minor=%d (err=%d)\n", | 680 | WATCHDOG_MINOR, ret); |
686 | WATCHDOG_MINOR, ret); | ||
687 | goto out_misc; | 681 | goto out_misc; |
688 | } | 682 | } |
689 | 683 | ||
690 | printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", | 684 | pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", |
691 | heartbeat, nowayout); | 685 | heartbeat, nowayout); |
692 | if (type == 501) | 686 | if (type == 501) |
693 | printk(KERN_INFO "wdt: Fan Tachometer is %s\n", | 687 | pr_info("Fan Tachometer is %s\n", |
694 | (tachometer ? "Enabled" : "Disabled")); | 688 | tachometer ? "Enabled" : "Disabled"); |
695 | 689 | ||
696 | ret = 0; | 690 | ret = 0; |
697 | out: | 691 | out: |
diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c index 5d7113c7e501..f18499eaeaa7 100644 --- a/drivers/watchdog/wm8350_wdt.c +++ b/drivers/watchdog/wm8350_wdt.c | |||
@@ -8,6 +8,8 @@ | |||
8 | * as published by the Free Software Foundation | 8 | * as published by the Free Software Foundation |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
12 | |||
11 | #include <linux/module.h> | 13 | #include <linux/module.h> |
12 | #include <linux/moduleparam.h> | 14 | #include <linux/moduleparam.h> |
13 | #include <linux/types.h> | 15 | #include <linux/types.h> |
diff --git a/drivers/watchdog/xen_wdt.c b/drivers/watchdog/xen_wdt.c index 49bd9d395562..79aa7f96c246 100644 --- a/drivers/watchdog/xen_wdt.c +++ b/drivers/watchdog/xen_wdt.c | |||
@@ -9,9 +9,10 @@ | |||
9 | * 2 of the License, or (at your option) any later version. | 9 | * 2 of the License, or (at your option) any later version. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
13 | |||
12 | #define DRV_NAME "wdt" | 14 | #define DRV_NAME "wdt" |
13 | #define DRV_VERSION "0.01" | 15 | #define DRV_VERSION "0.01" |
14 | #define PFX DRV_NAME ": " | ||
15 | 16 | ||
16 | #include <linux/bug.h> | 17 | #include <linux/bug.h> |
17 | #include <linux/errno.h> | 18 | #include <linux/errno.h> |
@@ -134,8 +135,7 @@ static int xen_wdt_release(struct inode *inode, struct file *file) | |||
134 | if (expect_release) | 135 | if (expect_release) |
135 | xen_wdt_stop(); | 136 | xen_wdt_stop(); |
136 | else { | 137 | else { |
137 | printk(KERN_CRIT PFX | 138 | pr_crit("unexpected close, not stopping watchdog!\n"); |
138 | "unexpected close, not stopping watchdog!\n"); | ||
139 | xen_wdt_kick(); | 139 | xen_wdt_kick(); |
140 | } | 140 | } |
141 | is_active = false; | 141 | is_active = false; |
@@ -251,30 +251,27 @@ static int __devinit xen_wdt_probe(struct platform_device *dev) | |||
251 | case -EINVAL: | 251 | case -EINVAL: |
252 | if (!timeout) { | 252 | if (!timeout) { |
253 | timeout = WATCHDOG_TIMEOUT; | 253 | timeout = WATCHDOG_TIMEOUT; |
254 | printk(KERN_INFO PFX | 254 | pr_info("timeout value invalid, using %d\n", timeout); |
255 | "timeout value invalid, using %d\n", timeout); | ||
256 | } | 255 | } |
257 | 256 | ||
258 | ret = misc_register(&xen_wdt_miscdev); | 257 | ret = misc_register(&xen_wdt_miscdev); |
259 | if (ret) { | 258 | if (ret) { |
260 | printk(KERN_ERR PFX | 259 | pr_err("cannot register miscdev on minor=%d (%d)\n", |
261 | "cannot register miscdev on minor=%d (%d)\n", | ||
262 | WATCHDOG_MINOR, ret); | 260 | WATCHDOG_MINOR, ret); |
263 | break; | 261 | break; |
264 | } | 262 | } |
265 | 263 | ||
266 | printk(KERN_INFO PFX | 264 | pr_info("initialized (timeout=%ds, nowayout=%d)\n", |
267 | "initialized (timeout=%ds, nowayout=%d)\n", | 265 | timeout, nowayout); |
268 | timeout, nowayout); | ||
269 | break; | 266 | break; |
270 | 267 | ||
271 | case -ENOSYS: | 268 | case -ENOSYS: |
272 | printk(KERN_INFO PFX "not supported\n"); | 269 | pr_info("not supported\n"); |
273 | ret = -ENODEV; | 270 | ret = -ENODEV; |
274 | break; | 271 | break; |
275 | 272 | ||
276 | default: | 273 | default: |
277 | printk(KERN_INFO PFX "bogus return value %d\n", ret); | 274 | pr_info("bogus return value %d\n", ret); |
278 | break; | 275 | break; |
279 | } | 276 | } |
280 | 277 | ||
@@ -326,7 +323,7 @@ static int __init xen_wdt_init_module(void) | |||
326 | if (!xen_domain()) | 323 | if (!xen_domain()) |
327 | return -ENODEV; | 324 | return -ENODEV; |
328 | 325 | ||
329 | printk(KERN_INFO PFX "Xen WatchDog Timer Driver v%s\n", DRV_VERSION); | 326 | pr_info("Xen WatchDog Timer Driver v%s\n", DRV_VERSION); |
330 | 327 | ||
331 | err = platform_driver_register(&xen_wdt_driver); | 328 | err = platform_driver_register(&xen_wdt_driver); |
332 | if (err) | 329 | if (err) |
@@ -346,7 +343,7 @@ static void __exit xen_wdt_cleanup_module(void) | |||
346 | { | 343 | { |
347 | platform_device_unregister(platform_device); | 344 | platform_device_unregister(platform_device); |
348 | platform_driver_unregister(&xen_wdt_driver); | 345 | platform_driver_unregister(&xen_wdt_driver); |
349 | printk(KERN_INFO PFX "module unloaded\n"); | 346 | pr_info("module unloaded\n"); |
350 | } | 347 | } |
351 | 348 | ||
352 | module_init(xen_wdt_init_module); | 349 | module_init(xen_wdt_init_module); |