Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Joe Perches and committed by
Wim Van Sebroeck
27c766aa 7cbc3535

+1039 -1280
+10 -14
drivers/watchdog/acquirewdt.c
··· 52 52 * Includes, defines, variables, module parameters, ... 53 53 */ 54 54 55 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 56 + 55 57 /* Includes */ 56 58 #include <linux/module.h> /* For module specific items */ 57 59 #include <linux/moduleparam.h> /* For new moduleparam's */ ··· 72 70 73 71 /* Module information */ 74 72 #define DRV_NAME "acquirewdt" 75 - #define PFX DRV_NAME ": " 76 73 #define WATCHDOG_NAME "Acquire WDT" 77 74 /* There is no way to see what the correct time-out period is */ 78 75 #define WATCHDOG_HEARTBEAT 0 ··· 209 208 if (expect_close == 42) { 210 209 acq_stop(); 211 210 } else { 212 - printk(KERN_CRIT PFX 213 - "Unexpected close, not stopping watchdog!\n"); 211 + pr_crit("Unexpected close, not stopping watchdog!\n"); 214 212 acq_keepalive(); 215 213 } 216 214 clear_bit(0, &acq_is_open); ··· 246 246 247 247 if (wdt_stop != wdt_start) { 248 248 if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { 249 - printk(KERN_ERR PFX 250 - "I/O address 0x%04x already in use\n", wdt_stop); 249 + pr_err("I/O address 0x%04x already in use\n", wdt_stop); 251 250 ret = -EIO; 252 251 goto out; 253 252 } 254 253 } 255 254 256 255 if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { 257 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 258 - wdt_start); 256 + pr_err("I/O address 0x%04x already in use\n", wdt_start); 259 257 ret = -EIO; 260 258 goto unreg_stop; 261 259 } 262 260 ret = misc_register(&acq_miscdev); 263 261 if (ret != 0) { 264 - printk(KERN_ERR PFX 265 - "cannot register miscdev on minor=%d (err=%d)\n", 266 - WATCHDOG_MINOR, ret); 262 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 263 + WATCHDOG_MINOR, ret); 267 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 268 return 0; 272 269 unreg_regions: ··· 305 308 { 306 309 int err; 307 310 308 - printk(KERN_INFO 309 - "WDT driver for Acquire single board computer initialising.\n"); 311 + pr_info("WDT driver for Acquire single board computer initialising\n"); 310 312 311 313 err = platform_driver_register(&acquirewdt_driver); 312 314 if (err) ··· 328 332 { 329 333 platform_device_unregister(acq_platform_device); 330 334 platform_driver_unregister(&acquirewdt_driver); 331 - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); 335 + pr_info("Watchdog Module Unloaded\n"); 332 336 } 333 337 334 338 module_init(acq_init);
+12 -18
drivers/watchdog/advantechwdt.c
··· 28 28 * add wdt_start and wdt_stop as parameters. 29 29 */ 30 30 31 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 32 + 31 33 #include <linux/module.h> 32 34 #include <linux/moduleparam.h> 33 35 #include <linux/types.h> ··· 45 43 #include <asm/system.h> 46 44 47 45 #define DRV_NAME "advantechwdt" 48 - #define PFX DRV_NAME ": " 49 46 #define WATCHDOG_NAME "Advantech WDT" 50 47 #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ 51 48 ··· 208 207 if (adv_expect_close == 42) { 209 208 advwdt_disable(); 210 209 } else { 211 - printk(KERN_CRIT PFX 212 - "Unexpected close, not stopping watchdog!\n"); 210 + pr_crit("Unexpected close, not stopping watchdog!\n"); 213 211 advwdt_ping(); 214 212 } 215 213 clear_bit(0, &advwdt_is_open); ··· 245 245 246 246 if (wdt_stop != wdt_start) { 247 247 if (!request_region(wdt_stop, 1, WATCHDOG_NAME)) { 248 - printk(KERN_ERR PFX 249 - "I/O address 0x%04x already in use\n", 250 - wdt_stop); 248 + pr_err("I/O address 0x%04x already in use\n", 249 + wdt_stop); 251 250 ret = -EIO; 252 251 goto out; 253 252 } 254 253 } 255 254 256 255 if (!request_region(wdt_start, 1, WATCHDOG_NAME)) { 257 - printk(KERN_ERR PFX 258 - "I/O address 0x%04x already in use\n", 259 - wdt_start); 256 + pr_err("I/O address 0x%04x already in use\n", wdt_start); 260 257 ret = -EIO; 261 258 goto unreg_stop; 262 259 } ··· 262 265 * if not reset to the default */ 263 266 if (advwdt_set_heartbeat(timeout)) { 264 267 advwdt_set_heartbeat(WATCHDOG_TIMEOUT); 265 - printk(KERN_INFO PFX 266 - "timeout value must be 1<=x<=63, using %d\n", timeout); 268 + pr_info("timeout value must be 1<=x<=63, using %d\n", timeout); 267 269 } 268 270 269 271 ret = misc_register(&advwdt_miscdev); 270 272 if (ret != 0) { 271 - printk(KERN_ERR PFX 272 - "cannot register miscdev on minor=%d (err=%d)\n", 273 - WATCHDOG_MINOR, ret); 273 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 274 + WATCHDOG_MINOR, ret); 274 275 goto unreg_regions; 275 276 } 276 - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", 277 + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", 277 278 timeout, nowayout); 278 279 out: 279 280 return ret; ··· 313 318 { 314 319 int err; 315 320 316 - printk(KERN_INFO 317 - "WDT driver for Advantech single board computer initialising.\n"); 321 + pr_info("WDT driver for Advantech single board computer initialising\n"); 318 322 319 323 err = platform_driver_register(&advwdt_driver); 320 324 if (err) ··· 337 343 { 338 344 platform_device_unregister(advwdt_platform_device); 339 345 platform_driver_unregister(&advwdt_driver); 340 - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); 346 + pr_info("Watchdog Module Unloaded\n"); 341 347 } 342 348 343 349 module_init(advwdt_init);
+9 -12
drivers/watchdog/alim1535_wdt.c
··· 7 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 12 #include <linux/module.h> 11 13 #include <linux/moduleparam.h> 12 14 #include <linux/types.h> ··· 24 22 #include <linux/io.h> 25 23 26 24 #define WATCHDOG_NAME "ALi_M1535" 27 - #define PFX WATCHDOG_NAME ": " 28 25 #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ 29 26 30 27 /* internal variables */ ··· 269 268 if (ali_expect_release == 42) 270 269 ali_stop(); 271 270 else { 272 - printk(KERN_CRIT PFX 273 - "Unexpected close, not stopping watchdog!\n"); 271 + pr_crit("Unexpected close, not stopping watchdog!\n"); 274 272 ali_keepalive(); 275 273 } 276 274 clear_bit(0, &ali_is_open); ··· 399 399 if not reset to the default */ 400 400 if (timeout < 1 || timeout >= 18000) { 401 401 timeout = WATCHDOG_TIMEOUT; 402 - printk(KERN_INFO PFX 403 - "timeout value must be 0 < timeout < 18000, using %d\n", 404 - timeout); 402 + pr_info("timeout value must be 0 < timeout < 18000, using %d\n", 403 + timeout); 405 404 } 406 405 407 406 /* Calculate the watchdog's timeout */ ··· 408 409 409 410 ret = register_reboot_notifier(&ali_notifier); 410 411 if (ret != 0) { 411 - printk(KERN_ERR PFX 412 - "cannot register reboot notifier (err=%d)\n", ret); 412 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 413 413 goto out; 414 414 } 415 415 416 416 ret = misc_register(&ali_miscdev); 417 417 if (ret != 0) { 418 - printk(KERN_ERR PFX 419 - "cannot register miscdev on minor=%d (err=%d)\n", 420 - WATCHDOG_MINOR, ret); 418 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 419 + WATCHDOG_MINOR, ret); 421 420 goto unreg_reboot; 422 421 } 423 422 424 - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", 423 + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", 425 424 timeout, nowayout); 426 425 427 426 out:
+18 -33
drivers/watchdog/alim7101_wdt.c
··· 19 19 * -- Mike Waychison <michael.waychison@sun.com> 20 20 */ 21 21 22 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 23 + 22 24 #include <linux/module.h> 23 25 #include <linux/moduleparam.h> 24 26 #include <linux/types.h> ··· 37 35 #include <linux/uaccess.h> 38 36 39 37 #include <asm/system.h> 40 - 41 - #define OUR_NAME "alim7101_wdt" 42 - #define PFX OUR_NAME ": " 43 38 44 39 #define WDT_ENABLE 0x9C 45 40 #define WDT_DISABLE 0x8C ··· 111 112 ALI_7101_GPIO_O, tmp & ~0x20); 112 113 } 113 114 } else { 114 - printk(KERN_WARNING PFX 115 - "Heartbeat lost! Will not ping the watchdog\n"); 115 + pr_warn("Heartbeat lost! Will not ping the watchdog\n"); 116 116 } 117 117 /* Re-set the timer interval */ 118 118 mod_timer(&timer, jiffies + WDT_INTERVAL); ··· 160 162 /* Start the timer */ 161 163 mod_timer(&timer, jiffies + WDT_INTERVAL); 162 164 163 - printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); 165 + pr_info("Watchdog timer is now enabled\n"); 164 166 } 165 167 166 168 static void wdt_turnoff(void) ··· 168 170 /* Stop the timer */ 169 171 del_timer_sync(&timer); 170 172 wdt_change(WDT_DISABLE); 171 - printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); 173 + pr_info("Watchdog timer is now disabled...\n"); 172 174 } 173 175 174 176 static void wdt_keepalive(void) ··· 224 226 wdt_turnoff(); 225 227 else { 226 228 /* wim: shouldn't there be a: del_timer(&timer); */ 227 - printk(KERN_CRIT PFX 228 - "device file closed unexpectedly. Will not stop the WDT!\n"); 229 + pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); 229 230 } 230 231 clear_bit(0, &wdt_is_open); 231 232 wdt_expect_close = 0; ··· 319 322 * watchdog on reboot with no heartbeat 320 323 */ 321 324 wdt_change(WDT_ENABLE); 322 - printk(KERN_INFO PFX "Watchdog timer is now enabled " 323 - "with no heartbeat - should reboot in ~1 second.\n"); 325 + pr_info("Watchdog timer is now enabled with no heartbeat - should reboot in ~1 second\n"); 324 326 } 325 327 return NOTIFY_DONE; 326 328 } ··· 348 352 struct pci_dev *ali1543_south; 349 353 char tmp; 350 354 351 - printk(KERN_INFO PFX "Steve Hill <steve@navaho.co.uk>.\n"); 355 + pr_info("Steve Hill <steve@navaho.co.uk>\n"); 352 356 alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 353 357 NULL); 354 358 if (!alim7101_pmu) { 355 - printk(KERN_INFO PFX 356 - "ALi M7101 PMU not present - WDT not set\n"); 359 + pr_info("ALi M7101 PMU not present - WDT not set\n"); 357 360 return -EBUSY; 358 361 } 359 362 ··· 362 367 ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 363 368 NULL); 364 369 if (!ali1543_south) { 365 - printk(KERN_INFO PFX 366 - "ALi 1543 South-Bridge not present - WDT not set\n"); 370 + pr_info("ALi 1543 South-Bridge not present - WDT not set\n"); 367 371 goto err_out; 368 372 } 369 373 pci_read_config_byte(ali1543_south, 0x5e, &tmp); 370 374 pci_dev_put(ali1543_south); 371 375 if ((tmp & 0x1e) == 0x00) { 372 376 if (!use_gpio) { 373 - printk(KERN_INFO PFX 374 - "Detected old alim7101 revision 'a1d'. " 375 - "If this is a cobalt board, set the 'use_gpio' " 376 - "module parameter.\n"); 377 + pr_info("Detected old alim7101 revision 'a1d'. If this is a cobalt board, set the 'use_gpio' module parameter.\n"); 377 378 goto err_out; 378 379 } 379 380 nowayout = 1; 380 381 } else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) { 381 - printk(KERN_INFO PFX 382 - "ALi 1543 South-Bridge does not have the correct " 383 - "revision number (???1001?) - WDT not set\n"); 382 + pr_info("ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n"); 384 383 goto err_out; 385 384 } 386 385 387 386 if (timeout < 1 || timeout > 3600) { 388 387 /* arbitrary upper limit */ 389 388 timeout = WATCHDOG_TIMEOUT; 390 - printk(KERN_INFO PFX 391 - "timeout value must be 1 <= x <= 3600, using %d\n", 392 - timeout); 389 + pr_info("timeout value must be 1 <= x <= 3600, using %d\n", 390 + timeout); 393 391 } 394 392 395 393 rc = register_reboot_notifier(&wdt_notifier); 396 394 if (rc) { 397 - printk(KERN_ERR PFX 398 - "cannot register reboot notifier (err=%d)\n", rc); 395 + pr_err("cannot register reboot notifier (err=%d)\n", rc); 399 396 goto err_out; 400 397 } 401 398 402 399 rc = misc_register(&wdt_miscdev); 403 400 if (rc) { 404 - printk(KERN_ERR PFX 405 - "cannot register miscdev on minor=%d (err=%d)\n", 406 - wdt_miscdev.minor, rc); 401 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 402 + wdt_miscdev.minor, rc); 407 403 goto err_out_reboot; 408 404 } 409 405 410 406 if (nowayout) 411 407 __module_get(THIS_MODULE); 412 408 413 - printk(KERN_INFO PFX "WDT driver for ALi M7101 initialised. " 414 - "timeout=%d sec (nowayout=%d)\n", 409 + pr_info("WDT driver for ALi M7101 initialised. timeout=%d sec (nowayout=%d)\n", 415 410 timeout, nowayout); 416 411 return 0; 417 412
+16 -18
drivers/watchdog/ar7_wdt.c
··· 23 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 28 #include <linux/module.h> 27 29 #include <linux/moduleparam.h> 28 30 #include <linux/errno.h> ··· 41 39 #include <asm/addrspace.h> 42 40 #include <asm/mach-ar7/ar7.h> 43 41 44 - #define DRVNAME "ar7_wdt" 45 42 #define LONGNAME "TI AR7 Watchdog Timer" 46 43 47 44 MODULE_AUTHOR("Nicolas Thill <nico@openwrt.org>"); ··· 94 93 return; 95 94 } 96 95 } 97 - printk(KERN_ERR DRVNAME ": failed to unlock WDT kick reg\n"); 96 + pr_err("failed to unlock WDT kick reg\n"); 98 97 } 99 98 100 99 static void ar7_wdt_prescale(u32 value) ··· 107 106 return; 108 107 } 109 108 } 110 - printk(KERN_ERR DRVNAME ": failed to unlock WDT prescale reg\n"); 109 + pr_err("failed to unlock WDT prescale reg\n"); 111 110 } 112 111 113 112 static void ar7_wdt_change(u32 value) ··· 120 119 return; 121 120 } 122 121 } 123 - printk(KERN_ERR DRVNAME ": failed to unlock WDT change reg\n"); 122 + pr_err("failed to unlock WDT change reg\n"); 124 123 } 125 124 126 125 static void ar7_wdt_disable(u32 value) ··· 136 135 } 137 136 } 138 137 } 139 - printk(KERN_ERR DRVNAME ": failed to unlock WDT disable reg\n"); 138 + pr_err("failed to unlock WDT disable reg\n"); 140 139 } 141 140 142 141 static void ar7_wdt_update_margin(int new_margin) ··· 152 151 change = 0xffff; 153 152 ar7_wdt_change(change); 154 153 margin = change * prescale_value / vbus_rate; 155 - printk(KERN_INFO DRVNAME 156 - ": timer margin %d seconds (prescale %d, change %d, freq %d)\n", 157 - margin, prescale_value, change, vbus_rate); 154 + pr_info("timer margin %d seconds (prescale %d, change %d, freq %d)\n", 155 + margin, prescale_value, change, vbus_rate); 158 156 } 159 157 160 158 static void ar7_wdt_enable_wdt(void) 161 159 { 162 - printk(KERN_DEBUG DRVNAME ": enabling watchdog timer\n"); 160 + pr_debug("enabling watchdog timer\n"); 163 161 ar7_wdt_disable(1); 164 162 ar7_wdt_kick(1); 165 163 } 166 164 167 165 static void ar7_wdt_disable_wdt(void) 168 166 { 169 - printk(KERN_DEBUG DRVNAME ": disabling watchdog timer\n"); 167 + pr_debug("disabling watchdog timer\n"); 170 168 ar7_wdt_disable(0); 171 169 } 172 170 ··· 183 183 static int ar7_wdt_release(struct inode *inode, struct file *file) 184 184 { 185 185 if (!expect_close) 186 - printk(KERN_WARNING DRVNAME 187 - ": watchdog device closed unexpectedly," 188 - "will not disable the watchdog timer\n"); 186 + pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n"); 189 187 else if (!nowayout) 190 188 ar7_wdt_disable_wdt(); 191 189 clear_bit(0, &wdt_is_open); ··· 281 283 ar7_regs_wdt = 282 284 platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); 283 285 if (!ar7_regs_wdt) { 284 - printk(KERN_ERR DRVNAME ": could not get registers resource\n"); 286 + pr_err("could not get registers resource\n"); 285 287 rc = -ENODEV; 286 288 goto out; 287 289 } 288 290 289 291 if (!request_mem_region(ar7_regs_wdt->start, 290 292 resource_size(ar7_regs_wdt), LONGNAME)) { 291 - printk(KERN_WARNING DRVNAME ": watchdog I/O region busy\n"); 293 + pr_warn("watchdog I/O region busy\n"); 292 294 rc = -EBUSY; 293 295 goto out; 294 296 } 295 297 296 298 ar7_wdt = ioremap(ar7_regs_wdt->start, resource_size(ar7_regs_wdt)); 297 299 if (!ar7_wdt) { 298 - printk(KERN_ERR DRVNAME ": could not ioremap registers\n"); 300 + pr_err("could not ioremap registers\n"); 299 301 rc = -ENXIO; 300 302 goto out_mem_region; 301 303 } 302 304 303 305 vbus_clk = clk_get(NULL, "vbus"); 304 306 if (IS_ERR(vbus_clk)) { 305 - printk(KERN_ERR DRVNAME ": could not get vbus clock\n"); 307 + pr_err("could not get vbus clock\n"); 306 308 rc = PTR_ERR(vbus_clk); 307 309 goto out_mem_region; 308 310 } ··· 313 315 314 316 rc = misc_register(&ar7_wdt_miscdev); 315 317 if (rc) { 316 - printk(KERN_ERR DRVNAME ": unable to register misc device\n"); 318 + pr_err("unable to register misc device\n"); 317 319 goto out_alloc; 318 320 } 319 321 goto out;
+6 -4
drivers/watchdog/at91rm9200_wdt.c
··· 9 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 14 #include <linux/bitops.h> 13 15 #include <linux/errno.h> 14 16 #include <linux/fs.h> ··· 211 209 if (res) 212 210 return res; 213 211 214 - printk(KERN_INFO "AT91 Watchdog Timer enabled (%d seconds%s)\n", 215 - wdt_time, nowayout ? ", nowayout" : ""); 212 + pr_info("AT91 Watchdog Timer enabled (%d seconds%s)\n", 213 + wdt_time, nowayout ? ", nowayout" : ""); 216 214 return 0; 217 215 } 218 216 ··· 270 268 if not reset to the default */ 271 269 if (at91_wdt_settimeout(wdt_time)) { 272 270 at91_wdt_settimeout(WDT_DEFAULT_TIME); 273 - pr_info("at91_wdt: wdt_time value must be 1 <= wdt_time <= 256" 274 - ", using %d\n", wdt_time); 271 + pr_info("wdt_time value must be 1 <= wdt_time <= 256, using %d\n", 272 + wdt_time); 275 273 } 276 274 277 275 return platform_driver_register(&at91wdt_driver);
+5 -3
drivers/watchdog/at91sam9_wdt.c
··· 15 15 * bootloader doesn't write to this register. 16 16 */ 17 17 18 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 19 + 18 20 #include <linux/errno.h> 19 21 #include <linux/fs.h> 20 22 #include <linux/init.h> ··· 98 96 at91_wdt_reset(); 99 97 mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT); 100 98 } else 101 - printk(KERN_CRIT DRV_NAME": I will reset your machine !\n"); 99 + pr_crit("I will reset your machine !\n"); 102 100 } 103 101 104 102 /* ··· 142 140 /* Check if disabled */ 143 141 mr = wdt_read(AT91_WDT_MR); 144 142 if (mr & AT91_WDT_WDDIS) { 145 - printk(KERN_ERR DRV_NAME": sorry, watchdog is disabled\n"); 143 + pr_err("sorry, watchdog is disabled\n"); 146 144 return -EIO; 147 145 } 148 146 ··· 285 283 setup_timer(&at91wdt_private.timer, at91_ping, 0); 286 284 mod_timer(&at91wdt_private.timer, jiffies + WDT_TIMEOUT); 287 285 288 - printk(KERN_INFO DRV_NAME " enabled (heartbeat=%d sec, nowayout=%d)\n", 286 + pr_info("enabled (heartbeat=%d sec, nowayout=%d)\n", 289 287 heartbeat, nowayout); 290 288 291 289 return 0;
+3 -2
drivers/watchdog/ath79_wdt.c
··· 17 17 * 18 18 */ 19 19 20 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 + 20 22 #include <linux/bitops.h> 21 23 #include <linux/errno.h> 22 24 #include <linux/fs.h> ··· 116 114 if (test_bit(WDT_FLAGS_EXPECT_CLOSE, &wdt_flags)) 117 115 ath79_wdt_disable(); 118 116 else { 119 - pr_crit(DRIVER_NAME ": device closed unexpectedly, " 120 - "watchdog timer will not stop!\n"); 117 + pr_crit("device closed unexpectedly, watchdog timer will not stop!\n"); 121 118 ath79_wdt_keepalive(); 122 119 } 123 120
+7 -7
drivers/watchdog/bcm47xx_wdt.c
··· 10 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 15 #include <linux/bitops.h> 14 16 #include <linux/errno.h> 15 17 #include <linux/fs.h> ··· 93 91 bcm47xx_wdt_hw_start(); 94 92 mod_timer(&wdt_timer, jiffies + HZ); 95 93 } else { 96 - printk(KERN_CRIT DRV_NAME "Watchdog will fire soon!!!\n"); 94 + pr_crit("Watchdog will fire soon!!!\n"); 97 95 } 98 96 } 99 97 ··· 142 140 if (expect_release == 42) { 143 141 bcm47xx_wdt_stop(); 144 142 } else { 145 - printk(KERN_CRIT DRV_NAME 146 - ": Unexpected close, not stopping watchdog!\n"); 143 + pr_crit("Unexpected close, not stopping watchdog!\n"); 147 144 bcm47xx_wdt_start(); 148 145 } 149 146 ··· 271 270 272 271 if (bcm47xx_wdt_settimeout(wdt_time)) { 273 272 bcm47xx_wdt_settimeout(WDT_DEFAULT_TIME); 274 - printk(KERN_INFO DRV_NAME ": " 275 - "wdt_time value must be 0 < wdt_time < %d, using %d\n", 273 + pr_info("wdt_time value must be 0 < wdt_time < %d, using %d\n", 276 274 (WDT_MAX_TIME + 1), wdt_time); 277 275 } 278 276 ··· 285 285 return ret; 286 286 } 287 287 288 - printk(KERN_INFO "BCM47xx Watchdog Timer enabled (%d seconds%s)\n", 289 - wdt_time, nowayout ? ", nowayout" : ""); 288 + pr_info("BCM47xx Watchdog Timer enabled (%d seconds%s)\n", 289 + wdt_time, nowayout ? ", nowayout" : ""); 290 290 return 0; 291 291 } 292 292
+4 -3
drivers/watchdog/bcm63xx_wdt.c
··· 10 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 15 #include <linux/bitops.h> 14 16 #include <linux/errno.h> 15 17 #include <linux/fs.h> ··· 84 82 bcm63xx_wdt_hw_start(); 85 83 mod_timer(&bcm63xx_wdt_device.timer, jiffies + HZ); 86 84 } else 87 - printk(KERN_CRIT PFX ": watchdog will restart system\n"); 85 + pr_crit("watchdog will restart system\n"); 88 86 } 89 87 90 88 static void bcm63xx_wdt_pet(void) ··· 128 126 if (expect_close == 42) 129 127 bcm63xx_wdt_pause(); 130 128 else { 131 - printk(KERN_CRIT PFX 132 - ": Unexpected close, not stopping watchdog!\n"); 129 + pr_crit("Unexpected close, not stopping watchdog!\n"); 133 130 bcm63xx_wdt_start(); 134 131 } 135 132 clear_bit(0, &bcm63xx_wdt_device.inuse);
+10 -17
drivers/watchdog/bfin_wdt.c
··· 11 11 * Licensed under the GPL-2 or later. 12 12 */ 13 13 14 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 15 + 14 16 #include <linux/platform_device.h> 15 17 #include <linux/module.h> 16 18 #include <linux/moduleparam.h> ··· 30 28 #define stamp(fmt, args...) \ 31 29 pr_debug("%s:%i: " fmt "\n", __func__, __LINE__, ## args) 32 30 #define stampit() stamp("here i am") 33 - #define pr_devinit(fmt, args...) \ 34 - ({ static const __devinitconst char __fmt[] = fmt; \ 35 - printk(__fmt, ## args); }) 36 - #define pr_init(fmt, args...) \ 37 - ({ static const __initconst char __fmt[] = fmt; \ 38 - printk(__fmt, ## args); }) 39 31 40 32 #define WATCHDOG_NAME "bfin-wdt" 41 - #define PFX WATCHDOG_NAME ": " 42 33 43 34 /* The BF561 has two watchdogs (one per core), but since Linux 44 35 * only runs on core A, we'll just work with that one. ··· 121 126 stamp("maxtimeout=%us newtimeout=%lus (cnt=%#x)", max_t, t, cnt); 122 127 123 128 if (t > max_t) { 124 - printk(KERN_WARNING PFX "timeout value is too large\n"); 129 + pr_warn("timeout value is too large\n"); 125 130 return -EINVAL; 126 131 } 127 132 ··· 177 182 if (expect_close == 42) 178 183 bfin_wdt_stop(); 179 184 else { 180 - printk(KERN_CRIT PFX 181 - "Unexpected close, not stopping watchdog!\n"); 185 + pr_crit("Unexpected close, not stopping watchdog!\n"); 182 186 bfin_wdt_keepalive(); 183 187 } 184 188 expect_close = 0; ··· 362 368 363 369 ret = misc_register(&bfin_wdt_miscdev); 364 370 if (ret) { 365 - pr_devinit(KERN_ERR PFX 366 - "cannot register miscdev on minor=%d (err=%d)\n", 367 - WATCHDOG_MINOR, ret); 371 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 372 + WATCHDOG_MINOR, ret); 368 373 return ret; 369 374 } 370 375 371 - pr_devinit(KERN_INFO PFX "initialized: timeout=%d sec (nowayout=%d)\n", 372 - timeout, nowayout); 376 + pr_info("initialized: timeout=%d sec (nowayout=%d)\n", 377 + timeout, nowayout); 373 378 374 379 return 0; 375 380 } ··· 432 439 */ 433 440 ret = platform_driver_register(&bfin_wdt_driver); 434 441 if (ret) { 435 - pr_init(KERN_ERR PFX "unable to register driver\n"); 442 + pr_err("unable to register driver\n"); 436 443 return ret; 437 444 } 438 445 439 446 bfin_wdt_device = platform_device_register_simple(WATCHDOG_NAME, 440 447 -1, NULL, 0); 441 448 if (IS_ERR(bfin_wdt_device)) { 442 - pr_init(KERN_ERR PFX "unable to register device\n"); 449 + pr_err("unable to register device\n"); 443 450 platform_driver_unregister(&bfin_wdt_driver); 444 451 return PTR_ERR(bfin_wdt_device); 445 452 }
+8 -6
drivers/watchdog/booke_wdt.c
··· 12 12 * option) any later version. 13 13 */ 14 14 15 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 16 + 15 17 #include <linux/module.h> 16 18 #include <linux/fs.h> 17 19 #include <linux/smp.h> ··· 227 225 if (booke_wdt_enabled == 0) { 228 226 booke_wdt_enabled = 1; 229 227 on_each_cpu(__booke_wdt_enable, NULL, 0); 230 - pr_debug("booke_wdt: watchdog enabled (timeout = %llu sec)\n", 231 - period_to_sec(booke_wdt_period)); 228 + pr_debug("watchdog enabled (timeout = %llu sec)\n", 229 + period_to_sec(booke_wdt_period)); 232 230 } 233 231 spin_unlock(&booke_wdt_lock); 234 232 ··· 245 243 */ 246 244 on_each_cpu(__booke_wdt_disable, NULL, 0); 247 245 booke_wdt_enabled = 0; 248 - pr_debug("booke_wdt: watchdog disabled\n"); 246 + pr_debug("watchdog disabled\n"); 249 247 #endif 250 248 251 249 clear_bit(0, &wdt_is_active); ··· 277 275 { 278 276 int ret = 0; 279 277 280 - pr_info("booke_wdt: powerpc book-e watchdog driver loaded\n"); 278 + pr_info("powerpc book-e watchdog driver loaded\n"); 281 279 ident.firmware_version = cur_cpu_spec->pvr_value; 282 280 283 281 ret = misc_register(&booke_wdt_miscdev); 284 282 if (ret) { 285 - pr_err("booke_wdt: cannot register device (minor=%u, ret=%i)\n", 283 + pr_err("cannot register device (minor=%u, ret=%i)\n", 286 284 WATCHDOG_MINOR, ret); 287 285 return ret; 288 286 } 289 287 290 288 spin_lock(&booke_wdt_lock); 291 289 if (booke_wdt_enabled == 1) { 292 - pr_info("booke_wdt: watchdog enabled (timeout = %llu sec)\n", 290 + pr_info("watchdog enabled (timeout = %llu sec)\n", 293 291 period_to_sec(booke_wdt_period)); 294 292 on_each_cpu(__booke_wdt_enable, NULL, 0); 295 293 }
+10 -9
drivers/watchdog/cpu5wdt.c
··· 19 19 * 20 20 */ 21 21 22 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 23 + 22 24 #include <linux/module.h> 23 25 #include <linux/moduleparam.h> 24 26 #include <linux/types.h> ··· 73 71 static void cpu5wdt_trigger(unsigned long unused) 74 72 { 75 73 if (verbose > 2) 76 - printk(KERN_DEBUG PFX "trigger at %i ticks\n", ticks); 74 + pr_debug("trigger at %i ticks\n", ticks); 77 75 78 76 if (cpu5wdt_device.running) 79 77 ticks--; ··· 98 96 ticks = cpu5wdt_device.default_ticks; 99 97 100 98 if (verbose) 101 - printk(KERN_DEBUG PFX "reset (%i ticks)\n", (int) ticks); 99 + pr_debug("reset (%i ticks)\n", (int) ticks); 102 100 103 101 } 104 102 ··· 131 129 ticks = cpu5wdt_device.default_ticks; 132 130 spin_unlock_irqrestore(&cpu5wdt_lock, flags); 133 131 if (verbose) 134 - printk(KERN_CRIT PFX "stop not possible\n"); 132 + pr_crit("stop not possible\n"); 135 133 return -EIO; 136 134 } 137 135 ··· 221 219 int err; 222 220 223 221 if (verbose) 224 - printk(KERN_DEBUG PFX 225 - "port=0x%x, verbose=%i\n", port, verbose); 222 + pr_debug("port=0x%x, verbose=%i\n", port, verbose); 226 223 227 224 init_completion(&cpu5wdt_device.stop); 228 225 cpu5wdt_device.queue = 0; ··· 229 228 cpu5wdt_device.default_ticks = ticks; 230 229 231 230 if (!request_region(port, CPU5WDT_EXTENT, PFX)) { 232 - printk(KERN_ERR PFX "request_region failed\n"); 231 + pr_err("request_region failed\n"); 233 232 err = -EBUSY; 234 233 goto no_port; 235 234 } ··· 238 237 val = inb(port + CPU5WDT_STATUS_REG); 239 238 val = (val >> 2) & 1; 240 239 if (!val) 241 - printk(KERN_INFO PFX "sorry, was my fault\n"); 240 + pr_info("sorry, was my fault\n"); 242 241 243 242 err = misc_register(&cpu5wdt_misc); 244 243 if (err < 0) { 245 - printk(KERN_ERR PFX "misc_register failed\n"); 244 + pr_err("misc_register failed\n"); 246 245 goto no_misc; 247 246 } 248 247 249 248 250 - printk(KERN_INFO PFX "init success\n"); 249 + pr_info("init success\n"); 251 250 return 0; 252 251 253 252 no_misc:
+10 -10
drivers/watchdog/cpwd.c
··· 14 14 * Copyright (C) 2008 David S. Miller <davem@davemloft.net> 15 15 */ 16 16 17 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 18 + 17 19 #include <linux/kernel.h> 18 20 #include <linux/module.h> 19 21 #include <linux/fs.h> ··· 37 35 #include <asm/watchdog.h> 38 36 39 37 #define DRIVER_NAME "cpwd" 40 - #define PFX DRIVER_NAME ": " 41 38 42 39 #define WD_OBPNAME "watchdog" 43 40 #define WD_BADMODEL "SUNW,501-5336" ··· 386 385 if (!p->initialized) { 387 386 if (request_irq(p->irq, &cpwd_interrupt, 388 387 IRQF_SHARED, DRIVER_NAME, p)) { 389 - printk(KERN_ERR PFX "Cannot register IRQ %d\n", 390 - p->irq); 388 + pr_err("Cannot register IRQ %d\n", p->irq); 391 389 mutex_unlock(&cpwd_mutex); 392 390 return -EBUSY; 393 391 } ··· 542 542 p = kzalloc(sizeof(*p), GFP_KERNEL); 543 543 err = -ENOMEM; 544 544 if (!p) { 545 - printk(KERN_ERR PFX "Unable to allocate struct cpwd.\n"); 545 + pr_err("Unable to allocate struct cpwd\n"); 546 546 goto out; 547 547 } 548 548 ··· 553 553 p->regs = of_ioremap(&op->resource[0], 0, 554 554 4 * WD_TIMER_REGSZ, DRIVER_NAME); 555 555 if (!p->regs) { 556 - printk(KERN_ERR PFX "Unable to map registers.\n"); 556 + pr_err("Unable to map registers\n"); 557 557 goto out_free; 558 558 } 559 559 560 560 options = of_find_node_by_path("/options"); 561 561 err = -ENODEV; 562 562 if (!options) { 563 - printk(KERN_ERR PFX "Unable to find /options node.\n"); 563 + pr_err("Unable to find /options node\n"); 564 564 goto out_iounmap; 565 565 } 566 566 ··· 605 605 606 606 err = misc_register(&p->devs[i].misc); 607 607 if (err) { 608 - printk(KERN_ERR "Could not register misc device for " 609 - "dev %d\n", i); 608 + pr_err("Could not register misc device for dev %d\n", 609 + i); 610 610 goto out_unregister; 611 611 } 612 612 } ··· 617 617 cpwd_timer.data = (unsigned long) p; 618 618 cpwd_timer.expires = WD_BTIMEOUT; 619 619 620 - printk(KERN_INFO PFX "PLD defect workaround enabled for " 621 - "model " WD_BADMODEL ".\n"); 620 + pr_info("PLD defect workaround enabled for model %s\n", 621 + WD_BADMODEL); 622 622 } 623 623 624 624 dev_set_drvdata(&op->dev, p);
+2 -1
drivers/watchdog/dw_wdt.c
··· 16 16 * If we receive an expected close for the watchdog then we keep the timer 17 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 22 #include <linux/bitops.h> 22 23 #include <linux/clk.h>
+5 -7
drivers/watchdog/ep93xx_wdt.c
··· 23 23 * - Add a few missing ioctls 24 24 */ 25 25 26 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 27 + 26 28 #include <linux/module.h> 27 29 #include <linux/fs.h> 28 30 #include <linux/miscdevice.h> ··· 35 33 #include <mach/hardware.h> 36 34 37 35 #define WDT_VERSION "0.3" 38 - #define PFX "ep93xx_wdt: " 39 36 40 37 /* default timeout (secs) */ 41 38 #define WDT_TIMEOUT 30 ··· 174 173 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 175 174 wdt_shutdown(); 176 175 else 177 - printk(KERN_CRIT PFX 178 - "Device closed unexpectedly - timer will not stop\n"); 176 + pr_crit("Device closed unexpectedly - timer will not stop\n"); 179 177 180 178 clear_bit(WDT_IN_USE, &wdt_status); 181 179 clear_bit(WDT_OK_TO_CLOSE, &wdt_status); ··· 214 214 215 215 boot_status = __raw_readl(EP93XX_WDT_WATCHDOG) & 0x01 ? 1 : 0; 216 216 217 - printk(KERN_INFO PFX "EP93XX watchdog, driver version " 218 - WDT_VERSION "%s\n", 217 + pr_info("EP93XX watchdog, driver version " WDT_VERSION "%s\n", 219 218 (__raw_readl(EP93XX_WDT_WATCHDOG) & 0x08) 220 219 ? " (nCS1 disable detected)" : ""); 221 220 222 221 if (timeout < 1 || timeout > 3600) { 223 222 timeout = WDT_TIMEOUT; 224 - printk(KERN_INFO PFX 225 - "timeout value must be 1<=x<=3600, using %d\n", 223 + pr_info("timeout value must be 1<=x<=3600, using %d\n", 226 224 timeout); 227 225 } 228 226
+13 -15
drivers/watchdog/eurotechwdt.c
··· 45 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 50 #include <linux/interrupt.h> 49 51 #include <linux/module.h> 50 52 #include <linux/moduleparam.h> ··· 146 144 147 145 /* Setting interrupt line */ 148 146 if (irq == 2 || irq > 15 || irq < 0) { 149 - printk(KERN_ERR ": invalid irq number\n"); 147 + pr_err("invalid irq number\n"); 150 148 irq = 0; /* if invalid we disable interrupt */ 151 149 } 152 150 if (irq == 0) 153 - printk(KERN_INFO ": interrupt disabled\n"); 151 + pr_info("interrupt disabled\n"); 154 152 155 153 eurwdt_write_reg(WDT_TIMER_CFG, irq << 4); 156 154 ··· 165 163 166 164 static irqreturn_t eurwdt_interrupt(int irq, void *dev_id) 167 165 { 168 - printk(KERN_CRIT "timeout WDT timeout\n"); 166 + pr_crit("timeout WDT timeout\n"); 169 167 170 168 #ifdef ONLY_TESTING 171 - printk(KERN_CRIT "Would Reboot.\n"); 169 + pr_crit("Would Reboot\n"); 172 170 #else 173 - printk(KERN_CRIT "Initiating system reboot.\n"); 171 + pr_crit("Initiating system reboot\n"); 174 172 emergency_restart(); 175 173 #endif 176 174 return IRQ_HANDLED; ··· 337 335 if (eur_expect_close == 42) 338 336 eurwdt_disable_timer(); 339 337 else { 340 - printk(KERN_CRIT 341 - "eurwdt: Unexpected close, not stopping watchdog!\n"); 338 + pr_crit("Unexpected close, not stopping watchdog!\n"); 342 339 eurwdt_ping(); 343 340 } 344 341 clear_bit(0, &eurwdt_is_open); ··· 430 429 431 430 ret = request_irq(irq, eurwdt_interrupt, 0, "eurwdt", NULL); 432 431 if (ret) { 433 - printk(KERN_ERR "eurwdt: IRQ %d is not free.\n", irq); 432 + pr_err("IRQ %d is not free\n", irq); 434 433 goto out; 435 434 } 436 435 437 436 if (!request_region(io, 2, "eurwdt")) { 438 - printk(KERN_ERR "eurwdt: IO %X is not free.\n", io); 437 + pr_err("IO %X is not free\n", io); 439 438 ret = -EBUSY; 440 439 goto outirq; 441 440 } 442 441 443 442 ret = register_reboot_notifier(&eurwdt_notifier); 444 443 if (ret) { 445 - printk(KERN_ERR 446 - "eurwdt: can't register reboot notifier (err=%d)\n", ret); 444 + pr_err("can't register reboot notifier (err=%d)\n", ret); 447 445 goto outreg; 448 446 } 449 447 450 448 ret = misc_register(&eurwdt_miscdev); 451 449 if (ret) { 452 - printk(KERN_ERR "eurwdt: can't misc_register on minor=%d\n", 453 - WATCHDOG_MINOR); 450 + pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR); 454 451 goto outreboot; 455 452 } 456 453 457 454 eurwdt_unlock_chip(); 458 455 459 456 ret = 0; 460 - printk(KERN_INFO "Eurotech WDT driver 0.01 at %X (Interrupt %d)" 461 - " - timeout event: %s\n", 457 + pr_info("Eurotech WDT driver 0.01 at %X (Interrupt %d) - timeout event: %s\n", 462 458 io, irq, (!strcmp("int", ev) ? "int" : "reboot")); 463 459 464 460 out:
+17 -23
drivers/watchdog/f71808e_wdt.c
··· 19 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 24 #include <linux/err.h> 23 25 #include <linux/fs.h> 24 26 #include <linux/init.h> ··· 191 189 { 192 190 /* Don't step on other drivers' I/O space by accident */ 193 191 if (!request_muxed_region(base, 2, DRVNAME)) { 194 - printk(KERN_ERR DRVNAME ": I/O address 0x%04x already in use\n", 195 - (int)base); 192 + pr_err("I/O address 0x%04x already in use\n", (int)base); 196 193 return -EBUSY; 197 194 } 198 195 ··· 218 217 { 219 218 if (timeout <= 0 220 219 || timeout > max_timeout) { 221 - printk(KERN_ERR DRVNAME ": watchdog timeout out of range\n"); 220 + pr_err("watchdog timeout out of range\n"); 222 221 return -EINVAL; 223 222 } 224 223 ··· 253 252 } else if (pw <= 5000) { 254 253 watchdog.pulse_val = 3; 255 254 } else { 256 - printk(KERN_ERR DRVNAME ": pulse width out of range\n"); 255 + pr_err("pulse width out of range\n"); 257 256 err = -EINVAL; 258 257 goto exit_unlock; 259 258 } ··· 310 309 if (ioaddr) 311 310 superio_set_bit(ioaddr, SIO_REG_MFUNCT1, 1); 312 311 } else { 313 - printk(KERN_ERR DRVNAME ": Invalid argument f71862fg_pin=%d\n", 314 - f71862fg_pin); 312 + pr_err("Invalid argument f71862fg_pin=%d\n", f71862fg_pin); 315 313 return -EINVAL; 316 314 } 317 315 return 0; ··· 487 487 488 488 if (!watchdog.expect_close) { 489 489 watchdog_keepalive(); 490 - printk(KERN_CRIT DRVNAME 491 - ": Unexpected close, not stopping watchdog!\n"); 490 + pr_crit("Unexpected close, not stopping watchdog!\n"); 492 491 } else if (!nowayout) { 493 492 watchdog_stop(); 494 493 } ··· 671 672 672 673 err = misc_register(&watchdog_miscdev); 673 674 if (err) { 674 - printk(KERN_ERR DRVNAME 675 - ": cannot register miscdev on minor=%d\n", 676 - watchdog_miscdev.minor); 675 + pr_err("cannot register miscdev on minor=%d\n", 676 + watchdog_miscdev.minor); 677 677 goto exit_reboot; 678 678 } 679 679 680 680 if (start_withtimeout) { 681 681 if (start_withtimeout <= 0 682 682 || start_withtimeout > max_timeout) { 683 - printk(KERN_ERR DRVNAME 684 - ": starting timeout out of range\n"); 683 + pr_err("starting timeout out of range\n"); 685 684 err = -EINVAL; 686 685 goto exit_miscdev; 687 686 } 688 687 689 688 err = watchdog_start(); 690 689 if (err) { 691 - printk(KERN_ERR DRVNAME 692 - ": cannot start watchdog timer\n"); 690 + pr_err("cannot start watchdog timer\n"); 693 691 goto exit_miscdev; 694 692 } 695 693 ··· 716 720 if (nowayout) 717 721 __module_get(THIS_MODULE); 718 722 719 - printk(KERN_INFO DRVNAME 720 - ": watchdog started with initial timeout of %u sec\n", 723 + pr_info("watchdog started with initial timeout of %u sec\n", 721 724 start_withtimeout); 722 725 } 723 726 ··· 741 746 742 747 devid = superio_inw(sioaddr, SIO_REG_MANID); 743 748 if (devid != SIO_FINTEK_ID) { 744 - pr_debug(DRVNAME ": Not a Fintek device\n"); 749 + pr_debug("Not a Fintek device\n"); 745 750 err = -ENODEV; 746 751 goto exit; 747 752 } ··· 769 774 err = -ENODEV; 770 775 goto exit; 771 776 default: 772 - printk(KERN_INFO DRVNAME ": Unrecognized Fintek device: %04x\n", 773 - (unsigned int)devid); 777 + pr_info("Unrecognized Fintek device: %04x\n", 778 + (unsigned int)devid); 774 779 err = -ENODEV; 775 780 goto exit; 776 781 } 777 782 778 - printk(KERN_INFO DRVNAME ": Found %s watchdog chip, revision %d\n", 783 + pr_info("Found %s watchdog chip, revision %d\n", 779 784 f71808e_names[watchdog.type], 780 785 (int)superio_inb(sioaddr, SIO_REG_DEVREV)); 781 786 exit: ··· 803 808 static void __exit f71808e_exit(void) 804 809 { 805 810 if (watchdog_is_running()) { 806 - printk(KERN_WARNING DRVNAME 807 - ": Watchdog timer still running, stopping it\n"); 811 + pr_warn("Watchdog timer still running, stopping it\n"); 808 812 watchdog_stop(); 809 813 } 810 814 misc_deregister(&watchdog_miscdev);
+6 -5
drivers/watchdog/gef_wdt.c
··· 24 24 * capabilities) a kernel-based watchdog. 25 25 */ 26 26 27 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 28 + 27 29 #include <linux/kernel.h> 28 30 #include <linux/compiler.h> 29 31 #include <linux/init.h> ··· 112 110 if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_FALSE, 113 111 GEF_WDC_ENABLE_SHIFT)) { 114 112 gef_wdt_service(); 115 - printk(KERN_NOTICE "gef_wdt: watchdog activated\n"); 113 + pr_notice("watchdog activated\n"); 116 114 } 117 115 } 118 116 ··· 120 118 { 121 119 if (gef_wdt_toggle_wdc(GEF_WDC_ENABLED_TRUE, 122 120 GEF_WDC_ENABLE_SHIFT)) 123 - printk(KERN_NOTICE "gef_wdt: watchdog deactivated\n"); 121 + pr_notice("watchdog deactivated\n"); 124 122 } 125 123 126 124 static void gef_wdt_set_timeout(unsigned int timeout) ··· 236 234 if (expect_close == 42) 237 235 gef_wdt_handler_disable(); 238 236 else { 239 - printk(KERN_CRIT 240 - "gef_wdt: unexpected close, not stopping timer!\n"); 237 + pr_crit("unexpected close, not stopping timer!\n"); 241 238 gef_wdt_service(); 242 239 } 243 240 expect_close = 0; ··· 314 313 315 314 static int __init gef_wdt_init(void) 316 315 { 317 - printk(KERN_INFO "GE watchdog driver\n"); 316 + pr_info("GE watchdog driver\n"); 318 317 return platform_driver_register(&gef_wdt_driver); 319 318 } 320 319
+3 -2
drivers/watchdog/geodewdt.c
··· 9 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 14 #include <linux/module.h> 14 15 #include <linux/moduleparam.h> ··· 101 100 geodewdt_disable(); 102 101 module_put(THIS_MODULE); 103 102 } else { 104 - printk(KERN_CRIT "Unexpected close - watchdog is not stopping.\n"); 103 + pr_crit("Unexpected close - watchdog is not stopping\n"); 105 104 geodewdt_ping(); 106 105 107 106 set_bit(WDT_FLAGS_ORPHAN, &wdt_flags); ··· 221 220 222 221 wdt_timer = cs5535_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING); 223 222 if (!wdt_timer) { 224 - printk(KERN_ERR "geodewdt: No timers were available\n"); 223 + pr_err("No timers were available\n"); 225 224 return -ENODEV; 226 225 } 227 226
+10 -17
drivers/watchdog/hpwdt.c
··· 13 13 * 14 14 */ 15 15 16 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 17 + 16 18 #include <linux/device.h> 17 19 #include <linux/fs.h> 18 20 #include <linux/init.h> ··· 237 235 asminline_call(&cmn_regs, bios32_entrypoint); 238 236 239 237 if (cmn_regs.u1.ral != 0) { 240 - printk(KERN_WARNING 241 - "hpwdt: Call succeeded but with an error: 0x%x\n", 238 + pr_warn("Call succeeded but with an error: 0x%x\n", 242 239 cmn_regs.u1.ral); 243 240 } else { 244 241 physical_bios_base = cmn_regs.u2.rebx; ··· 257 256 } 258 257 } 259 258 260 - printk(KERN_DEBUG "hpwdt: CRU Base Address: 0x%lx\n", 261 - physical_bios_base); 262 - printk(KERN_DEBUG "hpwdt: CRU Offset Address: 0x%lx\n", 263 - physical_bios_offset); 264 - printk(KERN_DEBUG "hpwdt: CRU Length: 0x%lx\n", 265 - cru_length); 266 - printk(KERN_DEBUG "hpwdt: CRU Mapped Address: %p\n", 267 - &cru_rom_addr); 259 + pr_debug("CRU Base Address: 0x%lx\n", physical_bios_base); 260 + pr_debug("CRU Offset Address: 0x%lx\n", physical_bios_offset); 261 + pr_debug("CRU Length: 0x%lx\n", cru_length); 262 + pr_debug("CRU Mapped Address: %p\n", &cru_rom_addr); 268 263 } 269 264 iounmap(bios32_map); 270 265 return retval; ··· 455 458 static int hpwdt_change_timer(int new_margin) 456 459 { 457 460 if (new_margin < 1 || new_margin > HPWDT_MAX_TIMER) { 458 - printk(KERN_WARNING 459 - "hpwdt: New value passed in is invalid: %d seconds.\n", 461 + pr_warn("New value passed in is invalid: %d seconds\n", 460 462 new_margin); 461 463 return -EINVAL; 462 464 } 463 465 464 466 soft_margin = new_margin; 465 - printk(KERN_DEBUG 466 - "hpwdt: New timer passed in is %d seconds.\n", 467 - new_margin); 467 + pr_debug("New timer passed in is %d seconds\n", new_margin); 468 468 reload = SECS_TO_TICKS(soft_margin); 469 469 470 470 return 0; ··· 529 535 if (expect_release == 42) { 530 536 hpwdt_stop(); 531 537 } else { 532 - printk(KERN_CRIT 533 - "hpwdt: Unexpected close, not stopping watchdog!\n"); 538 + pr_crit("Unexpected close, not stopping watchdog!\n"); 534 539 hpwdt_ping(); 535 540 } 536 541
+16 -19
drivers/watchdog/i6300esb.c
··· 27 27 * Includes, defines, variables, module parameters, ... 28 28 */ 29 29 30 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 31 + 30 32 #include <linux/module.h> 31 33 #include <linux/types.h> 32 34 #include <linux/kernel.h> ··· 46 44 #define ESB_VERSION "0.05" 47 45 #define ESB_MODULE_NAME "i6300ESB timer" 48 46 #define ESB_DRIVER_NAME ESB_MODULE_NAME ", v" ESB_VERSION 49 - #define PFX ESB_MODULE_NAME ": " 50 47 51 48 /* PCI configuration registers */ 52 49 #define ESB_CONFIG_REG 0x60 /* Config register */ ··· 214 213 if (esb_expect_close == 42) 215 214 esb_timer_stop(); 216 215 else { 217 - printk(KERN_CRIT PFX 218 - "Unexpected close, not stopping watchdog!\n"); 216 + pr_crit("Unexpected close, not stopping watchdog!\n"); 219 217 esb_timer_keepalive(); 220 218 } 221 219 clear_bit(0, &timer_alive); ··· 347 347 static unsigned char __devinit esb_getdevice(struct pci_dev *pdev) 348 348 { 349 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 351 goto err_devput; 352 352 } 353 353 354 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 356 goto err_disable; 357 357 } 358 358 359 359 BASEADDR = pci_ioremap_bar(pdev, 0); 360 360 if (BASEADDR == NULL) { 361 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 363 goto err_release; 364 364 } 365 365 ··· 397 397 /* Check that the WDT isn't already locked */ 398 398 pci_read_config_byte(esb_pci, ESB_LOCK_REG, &val1); 399 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 402 /* Set the timer to watchdog mode and disable it for now */ 403 403 pci_write_config_byte(esb_pci, ESB_LOCK_REG, 0x00); ··· 423 423 424 424 cards_found++; 425 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 427 ESB_VERSION); 428 428 429 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 431 return -ENODEV; 432 432 } 433 433 ··· 439 439 if not reset to the default */ 440 440 if (heartbeat < 0x1 || heartbeat > 2 * 0x03ff) { 441 441 heartbeat = WATCHDOG_HEARTBEAT; 442 - printk(KERN_INFO PFX 443 - "heartbeat value must be 1<heartbeat<2046, using %d\n", 444 - heartbeat); 442 + pr_info("heartbeat value must be 1<heartbeat<2046, using %d\n", 443 + heartbeat); 445 444 } 446 445 447 446 /* Initialize the watchdog and make sure it does not run */ ··· 449 450 /* Register the watchdog so that userspace has access to it */ 450 451 ret = misc_register(&esb_miscdev); 451 452 if (ret != 0) { 452 - printk(KERN_ERR PFX 453 - "cannot register miscdev on minor=%d (err=%d)\n", 454 - WATCHDOG_MINOR, ret); 453 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 454 + WATCHDOG_MINOR, ret); 455 455 goto err_unmap; 456 456 } 457 - printk(KERN_INFO PFX 458 - "initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", 459 - BASEADDR, heartbeat, nowayout); 457 + pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", 458 + BASEADDR, heartbeat, nowayout); 460 459 return 0; 461 460 462 461 err_unmap: ··· 500 503 static void __exit watchdog_cleanup(void) 501 504 { 502 505 pci_unregister_driver(&esb_driver); 503 - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); 506 + pr_info("Watchdog Module Unloaded\n"); 504 507 } 505 508 506 509 module_init(watchdog_init);
+4 -3
drivers/watchdog/iTCO_vendor_support.c
··· 17 17 * Includes, defines, variables, module parameters, ... 18 18 */ 19 19 20 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 + 20 22 /* Module and version information */ 21 23 #define DRV_NAME "iTCO_vendor_support" 22 24 #define DRV_VERSION "1.04" 23 - #define PFX DRV_NAME ": " 24 25 25 26 /* Includes */ 26 27 #include <linux/module.h> /* For module specific items */ ··· 356 355 357 356 static int __init iTCO_vendor_init_module(void) 358 357 { 359 - printk(KERN_INFO PFX "vendor-support=%d\n", vendorsupport); 358 + pr_info("vendor-support=%d\n", vendorsupport); 360 359 return 0; 361 360 } 362 361 363 362 static void __exit iTCO_vendor_exit_module(void) 364 363 { 365 - printk(KERN_INFO PFX "Module Unloaded\n"); 364 + pr_info("Module Unloaded\n"); 366 365 } 367 366 368 367 module_init(iTCO_vendor_init_module);
+23 -32
drivers/watchdog/iTCO_wdt.c
··· 43 43 * Includes, defines, variables, module parameters, ... 44 44 */ 45 45 46 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 47 + 46 48 /* Module and version information */ 47 49 #define DRV_NAME "iTCO_wdt" 48 50 #define DRV_VERSION "1.07" 49 - #define PFX DRV_NAME ": " 50 51 51 52 /* Includes */ 52 53 #include <linux/module.h> /* For module specific items */ ··· 490 489 /* disable chipset's NO_REBOOT bit */ 491 490 if (iTCO_wdt_unset_NO_REBOOT_bit()) { 492 491 spin_unlock(&iTCO_wdt_private.io_lock); 493 - printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, " 494 - "reboot disabled by hardware/BIOS\n"); 492 + pr_err("failed to reset NO_REBOOT flag, reboot disabled by hardware/BIOS\n"); 495 493 return -EIO; 496 494 } 497 495 ··· 661 661 if (expect_release == 42) { 662 662 iTCO_wdt_stop(); 663 663 } else { 664 - printk(KERN_CRIT PFX 665 - "Unexpected close, not stopping watchdog!\n"); 664 + pr_crit("Unexpected close, not stopping watchdog!\n"); 666 665 iTCO_wdt_keepalive(); 667 666 } 668 667 clear_bit(0, &is_active); ··· 803 804 base_address &= 0x0000ff80; 804 805 if (base_address == 0x00000000) { 805 806 /* Something's wrong here, ACPIBASE has to be set */ 806 - printk(KERN_ERR PFX "failed to get TCOBASE address, " 807 - "device disabled by hardware/BIOS\n"); 807 + pr_err("failed to get TCOBASE address, device disabled by hardware/BIOS\n"); 808 808 return -ENODEV; 809 809 } 810 810 iTCO_wdt_private.iTCO_version = ··· 818 820 if (iTCO_wdt_private.iTCO_version == 2) { 819 821 pci_read_config_dword(pdev, 0xf0, &base_address); 820 822 if ((base_address & 1) == 0) { 821 - printk(KERN_ERR PFX "RCBA is disabled by hardware" 822 - "/BIOS, device disabled\n"); 823 + pr_err("RCBA is disabled by hardware/BIOS, device disabled\n"); 823 824 ret = -ENODEV; 824 825 goto out; 825 826 } ··· 828 831 829 832 /* Check chipset's NO_REBOOT bit */ 830 833 if (iTCO_wdt_unset_NO_REBOOT_bit() && iTCO_vendor_check_noreboot_on()) { 831 - printk(KERN_INFO PFX "unable to reset NO_REBOOT flag, " 832 - "device disabled by hardware/BIOS\n"); 834 + pr_info("unable to reset NO_REBOOT flag, device disabled by hardware/BIOS\n"); 833 835 ret = -ENODEV; /* Cannot reset NO_REBOOT bit */ 834 836 goto out_unmap; 835 837 } ··· 838 842 839 843 /* The TCO logic uses the TCO_EN bit in the SMI_EN register */ 840 844 if (!request_region(SMI_EN, 4, "iTCO_wdt")) { 841 - printk(KERN_ERR PFX 842 - "I/O address 0x%04lx already in use, " 843 - "device disabled\n", SMI_EN); 845 + pr_err("I/O address 0x%04lx already in use, device disabled\n", 846 + SMI_EN); 844 847 ret = -EIO; 845 848 goto out_unmap; 846 849 } ··· 853 858 /* The TCO I/O registers reside in a 32-byte range pointed to 854 859 by the TCOBASE value */ 855 860 if (!request_region(TCOBASE, 0x20, "iTCO_wdt")) { 856 - printk(KERN_ERR PFX "I/O address 0x%04lx already in use " 857 - "device disabled\n", TCOBASE); 861 + pr_err("I/O address 0x%04lx already in use, device disabled\n", 862 + TCOBASE); 858 863 ret = -EIO; 859 864 goto unreg_smi_en; 860 865 } 861 866 862 - printk(KERN_INFO PFX 863 - "Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n", 864 - iTCO_chipset_info[ent->driver_data].name, 865 - iTCO_chipset_info[ent->driver_data].iTCO_version, 866 - TCOBASE); 867 + pr_info("Found a %s TCO device (Version=%d, TCOBASE=0x%04lx)\n", 868 + iTCO_chipset_info[ent->driver_data].name, 869 + iTCO_chipset_info[ent->driver_data].iTCO_version, 870 + TCOBASE); 867 871 868 872 /* Clear out the (probably old) status */ 869 873 outw(0x0008, TCO1_STS); /* Clear the Time Out Status bit */ ··· 876 882 if not reset to the default */ 877 883 if (iTCO_wdt_set_heartbeat(heartbeat)) { 878 884 iTCO_wdt_set_heartbeat(WATCHDOG_HEARTBEAT); 879 - printk(KERN_INFO PFX 880 - "timeout value out of range, using %d\n", heartbeat); 885 + pr_info("timeout value out of range, using %d\n", heartbeat); 881 886 } 882 887 883 888 ret = misc_register(&iTCO_wdt_miscdev); 884 889 if (ret != 0) { 885 - printk(KERN_ERR PFX 886 - "cannot register miscdev on minor=%d (err=%d)\n", 887 - WATCHDOG_MINOR, ret); 890 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 891 + WATCHDOG_MINOR, ret); 888 892 goto unreg_region; 889 893 } 890 894 891 - printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", 892 - heartbeat, nowayout); 895 + pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", 896 + heartbeat, nowayout); 893 897 894 898 return 0; 895 899 ··· 939 947 } 940 948 941 949 if (!found) 942 - printk(KERN_INFO PFX "No device detected.\n"); 950 + pr_info("No device detected\n"); 943 951 944 952 return ret; 945 953 } ··· 971 979 { 972 980 int err; 973 981 974 - printk(KERN_INFO PFX "Intel TCO WatchDog Timer Driver v%s\n", 975 - DRV_VERSION); 982 + pr_info("Intel TCO WatchDog Timer Driver v%s\n", DRV_VERSION); 976 983 977 984 err = platform_driver_register(&iTCO_wdt_driver); 978 985 if (err) ··· 995 1004 { 996 1005 platform_device_unregister(iTCO_wdt_platform_device); 997 1006 platform_driver_unregister(&iTCO_wdt_driver); 998 - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); 1007 + pr_info("Watchdog Module Unloaded\n"); 999 1008 } 1000 1009 1001 1010 module_init(iTCO_wdt_init_module);
+9 -13
drivers/watchdog/ib700wdt.c
··· 31 31 * 32 32 */ 33 33 34 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 35 + 34 36 #include <linux/module.h> 35 37 #include <linux/types.h> 36 38 #include <linux/miscdevice.h> ··· 55 53 56 54 /* Module information */ 57 55 #define DRV_NAME "ib700wdt" 58 - #define PFX DRV_NAME ": " 59 56 60 57 /* 61 58 * ··· 247 246 if (expect_close == 42) { 248 247 ibwdt_disable(); 249 248 } else { 250 - printk(KERN_CRIT PFX 251 - "WDT device closed unexpectedly. WDT will not stop!\n"); 249 + pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); 252 250 ibwdt_ping(); 253 251 } 254 252 clear_bit(0, &ibwdt_is_open); ··· 284 284 285 285 #if WDT_START != WDT_STOP 286 286 if (!request_region(WDT_STOP, 1, "IB700 WDT")) { 287 - printk(KERN_ERR PFX "STOP method I/O %X is not available.\n", 288 - WDT_STOP); 287 + pr_err("STOP method I/O %X is not available\n", WDT_STOP); 289 288 res = -EIO; 290 289 goto out_nostopreg; 291 290 } 292 291 #endif 293 292 294 293 if (!request_region(WDT_START, 1, "IB700 WDT")) { 295 - printk(KERN_ERR PFX "START method I/O %X is not available.\n", 296 - WDT_START); 294 + pr_err("START method I/O %X is not available\n", WDT_START); 297 295 res = -EIO; 298 296 goto out_nostartreg; 299 297 } ··· 300 302 * if not reset to the default */ 301 303 if (ibwdt_set_heartbeat(timeout)) { 302 304 ibwdt_set_heartbeat(WATCHDOG_TIMEOUT); 303 - printk(KERN_INFO PFX 304 - "timeout value must be 0<=x<=30, using %d\n", timeout); 305 + pr_info("timeout value must be 0<=x<=30, using %d\n", timeout); 305 306 } 306 307 307 308 res = misc_register(&ibwdt_miscdev); 308 309 if (res) { 309 - printk(KERN_ERR PFX "failed to register misc device\n"); 310 + pr_err("failed to register misc device\n"); 310 311 goto out_nomisc; 311 312 } 312 313 return 0; ··· 350 353 { 351 354 int err; 352 355 353 - printk(KERN_INFO PFX 354 - "WDT driver for IB700 single board computer initialising.\n"); 356 + pr_info("WDT driver for IB700 single board computer initialising\n"); 355 357 356 358 err = platform_driver_register(&ibwdt_driver); 357 359 if (err) ··· 374 378 { 375 379 platform_device_unregister(ibwdt_platform_device); 376 380 platform_driver_unregister(&ibwdt_driver); 377 - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); 381 + pr_info("Watchdog Module Unloaded\n"); 378 382 } 379 383 380 384 module_init(ibwdt_init);
+6 -8
drivers/watchdog/ibmasr.c
··· 10 10 * of the GNU Public License, incorporated herein by reference. 11 11 */ 12 12 13 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 14 + 13 15 #include <linux/fs.h> 14 16 #include <linux/kernel.h> 15 17 #include <linux/module.h> ··· 32 30 ASMTYPE_JUNIPER, 33 31 ASMTYPE_SPRUCE, 34 32 }; 35 - 36 - #define PFX "ibmasr: " 37 33 38 34 #define TOPAZ_ASR_REG_OFFSET 4 39 35 #define TOPAZ_ASR_TOGGLE 0x40 ··· 234 234 } 235 235 236 236 if (!request_region(asr_base, asr_length, "ibmasr")) { 237 - printk(KERN_ERR PFX "address %#x already in use\n", 238 - asr_base); 237 + pr_err("address %#x already in use\n", asr_base); 239 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 243 return 0; 245 244 } ··· 331 332 if (asr_expect_close == 42) 332 333 asr_disable(); 333 334 else { 334 - printk(KERN_CRIT PFX 335 - "unexpected close, not stopping watchdog!\n"); 335 + pr_crit("unexpected close, not stopping watchdog!\n"); 336 336 asr_toggle(); 337 337 } 338 338 clear_bit(0, &asr_is_open); ··· 391 393 rc = misc_register(&asr_miscdev); 392 394 if (rc < 0) { 393 395 release_region(asr_base, asr_length); 394 - printk(KERN_ERR PFX "failed to register misc device\n"); 396 + pr_err("failed to register misc device\n"); 395 397 return rc; 396 398 } 397 399
+8 -12
drivers/watchdog/indydog.c
··· 12 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 17 #include <linux/module.h> 16 18 #include <linux/moduleparam.h> 17 19 #include <linux/types.h> ··· 28 26 #include <linux/uaccess.h> 29 27 #include <asm/sgi/mc.h> 30 28 31 - #define PFX "indydog: " 32 29 static unsigned long indydog_alive; 33 30 static DEFINE_SPINLOCK(indydog_lock); 34 31 ··· 61 60 sgimc->cpuctrl0 = mc_ctrl0; 62 61 spin_unlock(&indydog_lock); 63 62 64 - printk(KERN_INFO PFX "Stopped watchdog timer.\n"); 63 + pr_info("Stopped watchdog timer\n"); 65 64 } 66 65 67 66 static void indydog_ping(void) ··· 84 83 indydog_start(); 85 84 indydog_ping(); 86 85 87 - printk(KERN_INFO "Started watchdog timer.\n"); 86 + pr_info("Started watchdog timer\n"); 88 87 89 88 return nonseekable_open(inode, file); 90 89 } ··· 179 178 .notifier_call = indydog_notify_sys, 180 179 }; 181 180 182 - static char banner[] __initdata = 183 - KERN_INFO PFX "Hardware Watchdog Timer for SGI IP22: 0.3\n"; 184 - 185 181 static int __init watchdog_init(void) 186 182 { 187 183 int ret; 188 184 189 185 ret = register_reboot_notifier(&indydog_notifier); 190 186 if (ret) { 191 - printk(KERN_ERR PFX 192 - "cannot register reboot notifier (err=%d)\n", ret); 187 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 193 188 return ret; 194 189 } 195 190 196 191 ret = misc_register(&indydog_miscdev); 197 192 if (ret) { 198 - printk(KERN_ERR PFX 199 - "cannot register miscdev on minor=%d (err=%d)\n", 200 - WATCHDOG_MINOR, ret); 193 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 194 + WATCHDOG_MINOR, ret); 201 195 unregister_reboot_notifier(&indydog_notifier); 202 196 return ret; 203 197 } 204 198 205 - printk(banner); 199 + pr_info("Hardware Watchdog Timer for SGI IP22: 0.3\n"); 206 200 207 201 return 0; 208 202 }
+34 -37
drivers/watchdog/intel_scu_watchdog.c
··· 22 22 * 23 23 */ 24 24 25 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 26 + 25 27 #include <linux/compiler.h> 26 28 #include <linux/module.h> 27 29 #include <linux/kernel.h> ··· 98 96 static void watchdog_fire(void) 99 97 { 100 98 if (force_boot) { 101 - printk(KERN_CRIT PFX "Initiating system reboot.\n"); 99 + pr_crit("Initiating system reboot\n"); 102 100 emergency_restart(); 103 - printk(KERN_CRIT PFX "Reboot didn't ?????\n"); 101 + pr_crit("Reboot didn't ?????\n"); 104 102 } 105 103 106 104 else { 107 - printk(KERN_CRIT PFX "Immediate Reboot Disabled\n"); 108 - printk(KERN_CRIT PFX 109 - "System will reset when watchdog timer times out!\n"); 105 + pr_crit("Immediate Reboot Disabled\n"); 106 + pr_crit("System will reset when watchdog timer times out!\n"); 110 107 } 111 108 } 112 109 ··· 113 112 { 114 113 if ((new_margin < MIN_TIME_CYCLE) || 115 114 (new_margin > MAX_TIME - timer_set)) { 116 - pr_debug("Watchdog timer: value of new_margin %d is out of the range %d to %d\n", 117 - new_margin, MIN_TIME_CYCLE, MAX_TIME - timer_set); 115 + 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); 118 117 return -EINVAL; 119 118 } 120 119 return 0; ··· 157 156 int int_status; 158 157 int_status = ioread32(watchdog_device.timer_interrupt_status_addr); 159 158 160 - pr_debug("Watchdog timer: irq, int_status: %x\n", int_status); 159 + pr_debug("irq, int_status: %x\n", int_status); 161 160 162 161 if (int_status != 0) 163 162 return IRQ_NONE; 164 163 165 164 /* has the timer been started? If not, then this is spurious */ 166 165 if (watchdog_device.timer_started == 0) { 167 - pr_debug("Watchdog timer: spurious interrupt received\n"); 166 + pr_debug("spurious interrupt received\n"); 168 167 return IRQ_HANDLED; 169 168 } 170 169 ··· 221 220 (watchdog_device.timer_set - timer_margin) 222 221 * watchdog_device.timer_tbl_ptr->freq_hz; 223 222 224 - pr_debug("Watchdog timer: set_heartbeat: timer freq is %d\n", 225 - watchdog_device.timer_tbl_ptr->freq_hz); 226 - pr_debug("Watchdog timer: set_heartbeat: timer_set is %x (hex)\n", 227 - watchdog_device.timer_set); 228 - pr_debug("Watchdog timer: set_hearbeat: timer_margin is %x (hex)\n", 229 - timer_margin); 230 - pr_debug("Watchdog timer: set_heartbeat: threshold is %x (hex)\n", 231 - watchdog_device.threshold); 232 - pr_debug("Watchdog timer: set_heartbeat: soft_threshold is %x (hex)\n", 233 - watchdog_device.soft_threshold); 223 + pr_debug("set_heartbeat: timer freq is %d\n", 224 + watchdog_device.timer_tbl_ptr->freq_hz); 225 + pr_debug("set_heartbeat: timer_set is %x (hex)\n", 226 + watchdog_device.timer_set); 227 + pr_debug("set_hearbeat: timer_margin is %x (hex)\n", timer_margin); 228 + pr_debug("set_heartbeat: threshold is %x (hex)\n", 229 + watchdog_device.threshold); 230 + pr_debug("set_heartbeat: soft_threshold is %x (hex)\n", 231 + watchdog_device.soft_threshold); 234 232 235 233 /* Adjust thresholds by FREQ_ADJUSTMENT factor, to make the */ 236 234 /* watchdog timing come out right. */ ··· 264 264 265 265 if (MAX_RETRY < retry_count++) { 266 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 268 return -ENODEV; 269 269 } 270 270 ··· 321 321 */ 322 322 323 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 325 return -ENOTTY; 326 326 } 327 327 328 328 if (!watchdog_device.timer_started) { 329 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 331 return 0; 332 332 } 333 333 334 - printk(KERN_CRIT PFX 335 - "Unexpected close of /dev/watchdog!\n"); 334 + pr_crit("Unexpected close of /dev/watchdog!\n"); 336 335 337 336 /* Since the timer was started, prevent future reopens */ 338 337 watchdog_device.driver_closed = 1; ··· 453 454 /* Check value of timer_set boot parameter */ 454 455 if ((timer_set < MIN_TIME_CYCLE) || 455 456 (timer_set > MAX_TIME - MIN_TIME_CYCLE)) { 456 - pr_err("Watchdog timer: value of timer_set %x (hex) " 457 - "is out of range from %x to %x (hex)\n", 458 - timer_set, MIN_TIME_CYCLE, MAX_TIME - MIN_TIME_CYCLE); 457 + pr_err("value of timer_set %x (hex) is out of range from %x to %x (hex)\n", 458 + timer_set, MIN_TIME_CYCLE, MAX_TIME - MIN_TIME_CYCLE); 459 459 return -EINVAL; 460 460 } 461 461 ··· 465 467 watchdog_device.timer_tbl_ptr = sfi_get_mtmr(sfi_mtimer_num-1); 466 468 467 469 if (watchdog_device.timer_tbl_ptr == NULL) { 468 - pr_debug("Watchdog timer - Intel SCU watchdog: timer is not available\n"); 470 + pr_debug("timer is not available\n"); 469 471 return -ENODEV; 470 472 } 471 473 /* make sure the timer exists */ 472 474 if (watchdog_device.timer_tbl_ptr->phys_addr == 0) { 473 - pr_debug("Watchdog timer - Intel SCU watchdog - timer %d does not have valid physical memory\n", 474 - sfi_mtimer_num); 475 + pr_debug("timer %d does not have valid physical memory\n", 476 + sfi_mtimer_num); 475 477 return -ENODEV; 476 478 } 477 479 478 480 if (watchdog_device.timer_tbl_ptr->irq == 0) { 479 - pr_debug("Watchdog timer: timer %d invalid irq\n", 480 - sfi_mtimer_num); 481 + pr_debug("timer %d invalid irq\n", sfi_mtimer_num); 481 482 return -ENODEV; 482 483 } 483 484 ··· 484 487 20); 485 488 486 489 if (tmp_addr == NULL) { 487 - pr_debug("Watchdog timer: timer unable to ioremap\n"); 490 + pr_debug("timer unable to ioremap\n"); 488 491 return -ENOMEM; 489 492 } 490 493 ··· 509 512 510 513 ret = register_reboot_notifier(&watchdog_device.intel_scu_notifier); 511 514 if (ret) { 512 - pr_err("Watchdog timer: cannot register notifier %d)\n", ret); 515 + pr_err("cannot register notifier %d)\n", ret); 513 516 goto register_reboot_error; 514 517 } 515 518 ··· 519 522 520 523 ret = misc_register(&watchdog_device.miscdev); 521 524 if (ret) { 522 - pr_err("Watchdog timer: cannot register miscdev %d err =%d\n", 523 - WATCHDOG_MINOR, ret); 525 + pr_err("cannot register miscdev %d err =%d\n", 526 + WATCHDOG_MINOR, ret); 524 527 goto misc_register_error; 525 528 } 526 529 ··· 529 532 IRQF_SHARED, "watchdog", 530 533 &watchdog_device.timer_load_count_addr); 531 534 if (ret) { 532 - pr_err("Watchdog timer: error requesting irq %d\n", ret); 535 + pr_err("error requesting irq %d\n", ret); 533 536 goto request_irq_error; 534 537 } 535 538 /* Make sure timer is disabled before returning */
-1
drivers/watchdog/intel_scu_watchdog.h
··· 25 25 #ifndef __INTEL_SCU_WATCHDOG_H 26 26 #define __INTEL_SCU_WATCHDOG_H 27 27 28 - #define PFX "Intel_SCU: " 29 28 #define WDT_VER "0.3" 30 29 31 30 /* minimum time between interrupts */
+6 -5
drivers/watchdog/iop_wdt.c
··· 24 24 * Dan Williams <dan.j.williams@intel.com> 25 25 */ 26 26 27 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 28 + 27 29 #include <linux/module.h> 28 30 #include <linux/kernel.h> 29 31 #include <linux/fs.h> ··· 87 85 write_wdtcr(IOP_WDTCR_DIS); 88 86 clear_bit(WDT_ENABLED, &wdt_status); 89 87 spin_unlock(&wdt_lock); 90 - printk(KERN_INFO "WATCHDOG: Disabled\n"); 88 + pr_info("Disabled\n"); 91 89 return 0; 92 90 } else 93 91 return 1; ··· 199 197 */ 200 198 if (state != 0) { 201 199 wdt_enable(); 202 - printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " 203 - "reset in %lu seconds\n", iop_watchdog_timeout()); 200 + pr_crit("Device closed unexpectedly - reset in %lu seconds\n", 201 + iop_watchdog_timeout()); 204 202 } 205 203 206 204 clear_bit(WDT_IN_USE, &wdt_status); ··· 240 238 with an open */ 241 239 ret = misc_register(&iop_wdt_miscdev); 242 240 if (ret == 0) 243 - printk(KERN_INFO "iop watchdog timer: timeout %lu sec\n", 244 - iop_watchdog_timeout()); 241 + pr_info("timeout %lu sec\n", iop_watchdog_timeout()); 245 242 246 243 return ret; 247 244 }
+17 -18
drivers/watchdog/it8712f_wdt.c
··· 20 20 * software is provided AS-IS with no warranties. 21 21 */ 22 22 23 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 24 + 23 25 #include <linux/module.h> 24 26 #include <linux/moduleparam.h> 25 27 #include <linux/init.h> ··· 35 33 #include <linux/io.h> 36 34 #include <linux/ioport.h> 37 35 36 + #define DEBUG 38 37 #define NAME "it8712f_wdt" 39 38 40 39 MODULE_AUTHOR("Jorge Boncompte - DTI2 <jorge@dti2.net>"); ··· 161 158 */ 162 159 if (units <= max_units) { 163 160 config |= WDT_UNIT_SEC; /* else UNIT is MINUTES */ 164 - printk(KERN_INFO NAME ": timer margin %d seconds\n", units); 161 + pr_info("timer margin %d seconds\n", units); 165 162 } else { 166 163 units /= 60; 167 - printk(KERN_INFO NAME ": timer margin %d minutes\n", units); 164 + pr_info("timer margin %d minutes\n", units); 168 165 } 169 166 superio_outb(config, WDT_CONFIG); 170 167 ··· 187 184 if (ret) 188 185 return ret; 189 186 190 - printk(KERN_DEBUG NAME ": enabling watchdog timer\n"); 187 + pr_debug("enabling watchdog timer\n"); 191 188 superio_select(LDN_GPIO); 192 189 193 190 superio_outb(wdt_control_reg, WDT_CONTROL); ··· 207 204 if (ret) 208 205 return ret; 209 206 210 - printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); 207 + pr_debug("disabling watchdog timer\n"); 211 208 superio_select(LDN_GPIO); 212 209 213 210 superio_outb(0, WDT_CONFIG); ··· 334 331 static int it8712f_wdt_release(struct inode *inode, struct file *file) 335 332 { 336 333 if (expect_close != 42) { 337 - printk(KERN_WARNING NAME 338 - ": watchdog device closed unexpectedly, will not" 339 - " disable the watchdog timer\n"); 334 + pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n"); 340 335 } else if (!nowayout) { 341 336 if (it8712f_wdt_disable()) 342 - printk(KERN_WARNING NAME "Watchdog disable failed\n"); 337 + pr_warn("Watchdog disable failed\n"); 343 338 } 344 339 expect_close = 0; 345 340 clear_bit(0, &wdt_open); ··· 375 374 superio_select(LDN_GAME); 376 375 superio_outb(1, ACT_REG); 377 376 if (!(superio_inb(ACT_REG) & 0x01)) { 378 - printk(KERN_ERR NAME ": Device not activated, skipping\n"); 377 + pr_err("Device not activated, skipping\n"); 379 378 goto exit; 380 379 } 381 380 382 381 *address = superio_inw(BASE_REG); 383 382 if (*address == 0) { 384 - printk(KERN_ERR NAME ": Base address not set, skipping\n"); 383 + pr_err("Base address not set, skipping\n"); 385 384 goto exit; 386 385 } 387 386 ··· 395 394 if (margin > (max_units * 60)) 396 395 margin = (max_units * 60); 397 396 398 - printk(KERN_INFO NAME ": Found IT%04xF chip revision %d - " 399 - "using DogFood address 0x%x\n", 397 + pr_info("Found IT%04xF chip revision %d - using DogFood address 0x%x\n", 400 398 chip_type, revision, *address); 401 399 402 400 exit: ··· 411 411 return -ENODEV; 412 412 413 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 415 return -EBUSY; 416 416 } 417 417 418 418 err = it8712f_wdt_disable(); 419 419 if (err) { 420 - printk(KERN_ERR NAME ": unable to disable watchdog timer.\n"); 420 + pr_err("unable to disable watchdog timer\n"); 421 421 goto out; 422 422 } 423 423 424 424 err = register_reboot_notifier(&it8712f_wdt_notifier); 425 425 if (err) { 426 - printk(KERN_ERR NAME ": unable to register reboot notifier\n"); 426 + pr_err("unable to register reboot notifier\n"); 427 427 goto out; 428 428 } 429 429 430 430 err = misc_register(&it8712f_wdt_miscdev); 431 431 if (err) { 432 - printk(KERN_ERR NAME 433 - ": cannot register miscdev on minor=%d (err=%d)\n", 434 - WATCHDOG_MINOR, err); 432 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 433 + WATCHDOG_MINOR, err); 435 434 goto reboot_out; 436 435 } 437 436
+17 -25
drivers/watchdog/it87_wdt.c
··· 29 29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 30 30 */ 31 31 32 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 33 + 32 34 #include <linux/module.h> 33 35 #include <linux/moduleparam.h> 34 36 #include <linux/types.h> ··· 49 47 50 48 #define WATCHDOG_VERSION "1.14" 51 49 #define WATCHDOG_NAME "IT87 WDT" 52 - #define PFX WATCHDOG_NAME ": " 53 50 #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" 54 51 #define WD_MAGIC 'V' 55 52 ··· 429 428 clear_bit(WDTS_TIMER_RUN, &wdt_status); 430 429 } else { 431 430 wdt_keepalive(); 432 - printk(KERN_CRIT PFX 433 - "unexpected close, not stopping watchdog!\n"); 431 + pr_crit("unexpected close, not stopping watchdog!\n"); 434 432 } 435 433 } 436 434 clear_bit(WDTS_DEV_OPEN, &wdt_status); ··· 621 621 try_gameport = 0; 622 622 break; 623 623 case IT8705_ID: 624 - printk(KERN_ERR PFX 625 - "Unsupported Chip found, Chip %04x Revision %02x\n", 624 + pr_err("Unsupported Chip found, Chip %04x Revision %02x\n", 626 625 chip_type, chip_rev); 627 626 return -ENODEV; 628 627 case NO_DEV_ID: 629 - printk(KERN_ERR PFX "no device\n"); 628 + pr_err("no device\n"); 630 629 return -ENODEV; 631 630 default: 632 - printk(KERN_ERR PFX 633 - "Unknown Chip found, Chip %04x Revision %04x\n", 631 + pr_err("Unknown Chip found, Chip %04x Revision %04x\n", 634 632 chip_type, chip_rev); 635 633 return -ENODEV; 636 634 } ··· 661 663 if (!test_bit(WDTS_USE_GP, &wdt_status)) { 662 664 if (!request_region(CIR_BASE, 8, WATCHDOG_NAME)) { 663 665 if (gp_rreq_fail) 664 - printk(KERN_ERR PFX 665 - "I/O Address 0x%04x and 0x%04x" 666 - " already in use\n", base, CIR_BASE); 666 + pr_err("I/O Address 0x%04x and 0x%04x already in use\n", 667 + base, CIR_BASE); 667 668 else 668 - printk(KERN_ERR PFX 669 - "I/O Address 0x%04x already in use\n", 670 - CIR_BASE); 669 + pr_err("I/O Address 0x%04x already in use\n", 670 + CIR_BASE); 671 671 rc = -EIO; 672 672 goto err_out; 673 673 } ··· 684 688 685 689 if (timeout < 1 || timeout > max_units * 60) { 686 690 timeout = DEFAULT_TIMEOUT; 687 - printk(KERN_WARNING PFX 688 - "Timeout value out of range, use default %d sec\n", 689 - DEFAULT_TIMEOUT); 691 + pr_warn("Timeout value out of range, use default %d sec\n", 692 + DEFAULT_TIMEOUT); 690 693 } 691 694 692 695 if (timeout > max_units) ··· 693 698 694 699 rc = register_reboot_notifier(&wdt_notifier); 695 700 if (rc) { 696 - printk(KERN_ERR PFX 697 - "Cannot register reboot notifier (err=%d)\n", rc); 701 + pr_err("Cannot register reboot notifier (err=%d)\n", rc); 698 702 goto err_out_region; 699 703 } 700 704 701 705 rc = misc_register(&wdt_miscdev); 702 706 if (rc) { 703 - printk(KERN_ERR PFX 704 - "Cannot register miscdev on minor=%d (err=%d)\n", 705 - wdt_miscdev.minor, rc); 707 + pr_err("Cannot register miscdev on minor=%d (err=%d)\n", 708 + wdt_miscdev.minor, rc); 706 709 goto err_out_reboot; 707 710 } 708 711 ··· 715 722 outb(0x09, CIR_IER(base)); 716 723 } 717 724 718 - printk(KERN_INFO PFX "Chip IT%04x revision %d initialized. " 719 - "timeout=%d sec (nowayout=%d testmode=%d exclusive=%d " 720 - "nogameport=%d)\n", chip_type, chip_rev, timeout, 725 + pr_info("Chip IT%04x revision %d initialized. timeout=%d sec (nowayout=%d testmode=%d exclusive=%d nogameport=%d)\n", 726 + chip_type, chip_rev, timeout, 721 727 nowayout, testmode, exclusive, nogameport); 722 728 723 729 superio_exit();
+4 -3
drivers/watchdog/ixp2000_wdt.c
··· 16 16 * warranty of any kind, whether express or implied. 17 17 */ 18 18 19 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 20 + 19 21 #include <linux/module.h> 20 22 #include <linux/moduleparam.h> 21 23 #include <linux/types.h> ··· 160 158 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 161 159 wdt_disable(); 162 160 else 163 - printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " 164 - "timer will not stop\n"); 161 + pr_crit("Device closed unexpectedly - timer will not stop\n"); 165 162 clear_bit(WDT_IN_USE, &wdt_status); 166 163 clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 167 164 ··· 186 185 static int __init ixp2000_wdt_init(void) 187 186 { 188 187 if ((*IXP2000_PRODUCT_ID & 0x001ffef0) == 0x00000000) { 189 - printk(KERN_INFO "Unable to use IXP2000 watchdog due to IXP2800 erratum #25.\n"); 188 + pr_info("Unable to use IXP2000 watchdog due to IXP2800 erratum #25\n"); 190 189 return -EIO; 191 190 } 192 191 wdt_tick_rate = (*IXP2000_T1_CLD * HZ) / 256;
+5 -6
drivers/watchdog/ixp4xx_wdt.c
··· 13 13 * warranty of any kind, whether express or implied. 14 14 */ 15 15 16 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 17 + 16 18 #include <linux/module.h> 17 19 #include <linux/moduleparam.h> 18 20 #include <linux/types.h> ··· 149 147 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 150 148 wdt_disable(); 151 149 else 152 - printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " 153 - "timer will not stop\n"); 150 + pr_crit("Device closed unexpectedly - timer will not stop\n"); 154 151 clear_bit(WDT_IN_USE, &wdt_status); 155 152 clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 156 153 ··· 177 176 int ret; 178 177 179 178 if (!(read_cpuid_id() & 0xf) && !cpu_is_ixp46x()) { 180 - printk(KERN_ERR "IXP4XXX Watchdog: Rev. A0 IXP42x CPU detected" 181 - " - watchdog disabled\n"); 179 + pr_err("Rev. A0 IXP42x CPU detected - watchdog disabled\n"); 182 180 183 181 return -ENODEV; 184 182 } ··· 185 185 WDIOF_CARDRESET : 0; 186 186 ret = misc_register(&ixp4xx_wdt_miscdev); 187 187 if (ret == 0) 188 - printk(KERN_INFO "IXP4xx Watchdog Timer: heartbeat %d sec\n", 189 - heartbeat); 188 + pr_info("timer heartbeat %d sec\n", heartbeat); 190 189 return ret; 191 190 } 192 191
+4 -2
drivers/watchdog/ks8695_wdt.c
··· 8 8 * published by the Free Software Foundation. 9 9 */ 10 10 11 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 12 + 11 13 #include <linux/bitops.h> 12 14 #include <linux/errno.h> 13 15 #include <linux/fs.h> ··· 235 233 if (res) 236 234 return res; 237 235 238 - printk(KERN_INFO "KS8695 Watchdog Timer enabled (%d seconds%s)\n", 239 - wdt_time, nowayout ? ", nowayout" : ""); 236 + pr_info("KS8695 Watchdog Timer enabled (%d seconds%s)\n", 237 + wdt_time, nowayout ? ", nowayout" : ""); 240 238 return 0; 241 239 } 242 240
+3 -1
drivers/watchdog/lantiq_wdt.c
··· 7 7 * Based on EP93xx wdt driver 8 8 */ 9 9 10 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 11 + 10 12 #include <linux/module.h> 11 13 #include <linux/fs.h> 12 14 #include <linux/miscdevice.h> ··· 162 160 if (ltq_wdt_ok_to_close) 163 161 ltq_wdt_disable(); 164 162 else 165 - pr_err("ltq_wdt: watchdog closed without warning\n"); 163 + pr_err("watchdog closed without warning\n"); 166 164 ltq_wdt_ok_to_close = 0; 167 165 clear_bit(0, &ltq_wdt_in_use); 168 166
+5 -5
drivers/watchdog/m54xx_wdt.c
··· 16 16 * warranty of any kind, whether express or implied. 17 17 */ 18 18 19 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 20 + 19 21 #include <linux/module.h> 20 22 #include <linux/moduleparam.h> 21 23 #include <linux/types.h> ··· 168 166 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 169 167 wdt_disable(); 170 168 else { 171 - printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " 172 - "timer will not stop\n"); 169 + pr_crit("Device closed unexpectedly - timer will not stop\n"); 173 170 wdt_keepalive(); 174 171 } 175 172 clear_bit(WDT_IN_USE, &wdt_status); ··· 197 196 { 198 197 if (!request_mem_region(MCF_MBAR + MCF_GPT_GCIR0, 4, 199 198 "Coldfire M54xx Watchdog")) { 200 - printk(KERN_WARNING 201 - "Coldfire M54xx Watchdog : I/O region busy\n"); 199 + pr_warn("I/O region busy\n"); 202 200 return -EBUSY; 203 201 } 204 - printk(KERN_INFO "ColdFire watchdog driver is loaded.\n"); 202 + pr_info("driver is loaded\n"); 205 203 206 204 return misc_register(&m54xx_wdt_miscdev); 207 205 }
+15 -18
drivers/watchdog/machzwd.c
··· 28 28 * Added nowayout module option to override CONFIG_WATCHDOG_NOWAYOUT 29 29 */ 30 30 31 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 32 + 31 33 #include <linux/module.h> 32 34 #include <linux/moduleparam.h> 33 35 #include <linux/types.h> ··· 143 141 #define ZF_CTIMEOUT 0xffff 144 142 145 143 #ifndef ZF_DEBUG 146 - # define dprintk(format, args...) 144 + #define dprintk(format, args...) 147 145 #else 148 - # define dprintk(format, args...) printk(KERN_DEBUG PFX \ 149 - ":%s:%d: " format, __func__, __LINE__ , ## args) 146 + #define dprintk(format, args...) \ 147 + pr_debug(":%s:%d: " format, __func__, __LINE__ , ## args) 150 148 #endif 151 149 152 150 ··· 205 203 zf_set_control(ctrl_reg); 206 204 spin_unlock_irqrestore(&zf_port_lock, flags); 207 205 208 - printk(KERN_INFO PFX ": Watchdog timer is now disabled\n"); 206 + pr_info("Watchdog timer is now disabled\n"); 209 207 } 210 208 211 209 ··· 235 233 zf_set_control(ctrl_reg); 236 234 spin_unlock_irqrestore(&zf_port_lock, flags); 237 235 238 - printk(KERN_INFO PFX ": Watchdog timer is now enabled\n"); 236 + pr_info("Watchdog timer is now enabled\n"); 239 237 } 240 238 241 239 ··· 265 263 266 264 mod_timer(&zf_timer, jiffies + ZF_HW_TIMEO); 267 265 } else 268 - printk(KERN_CRIT PFX ": I will reset your machine\n"); 266 + pr_crit("I will reset your machine\n"); 269 267 } 270 268 271 269 static ssize_t zf_write(struct file *file, const char __user *buf, size_t count, ··· 344 342 zf_timer_off(); 345 343 else { 346 344 del_timer(&zf_timer); 347 - printk(KERN_ERR PFX ": device file closed unexpectedly. " 348 - "Will not stop the WDT!\n"); 345 + pr_err("device file closed unexpectedly. Will not stop the WDT!\n"); 349 346 } 350 347 clear_bit(0, &zf_is_open); 351 348 zf_expect_close = 0; ··· 391 390 { 392 391 static const char * const str[] = { "RESET", "SMI", "NMI", "SCI" }; 393 392 394 - printk(KERN_INFO PFX ": Watchdog using action = %s\n", str[act]); 393 + pr_info("Watchdog using action = %s\n", str[act]); 395 394 } 396 395 397 396 static int __init zf_init(void) 398 397 { 399 398 int ret; 400 399 401 - printk(KERN_INFO PFX 402 - ": MachZ ZF-Logic Watchdog driver initializing.\n"); 400 + pr_info("MachZ ZF-Logic Watchdog driver initializing\n"); 403 401 404 402 ret = zf_get_ZFL_version(); 405 403 if (!ret || ret == 0xffff) { 406 - printk(KERN_WARNING PFX ": no ZF-Logic found\n"); 404 + pr_warn("no ZF-Logic found\n"); 407 405 return -ENODEV; 408 406 } 409 407 ··· 414 414 zf_show_action(action); 415 415 416 416 if (!request_region(ZF_IOBASE, 3, "MachZ ZFL WDT")) { 417 - printk(KERN_ERR "cannot reserve I/O ports at %d\n", 418 - ZF_IOBASE); 417 + pr_err("cannot reserve I/O ports at %d\n", ZF_IOBASE); 419 418 ret = -EBUSY; 420 419 goto no_region; 421 420 } 422 421 423 422 ret = register_reboot_notifier(&zf_notifier); 424 423 if (ret) { 425 - printk(KERN_ERR "can't register reboot notifier (err=%d)\n", 426 - ret); 424 + pr_err("can't register reboot notifier (err=%d)\n", ret); 427 425 goto no_reboot; 428 426 } 429 427 430 428 ret = misc_register(&zf_miscdev); 431 429 if (ret) { 432 - printk(KERN_ERR "can't misc_register on minor=%d\n", 433 - WATCHDOG_MINOR); 430 + pr_err("can't misc_register on minor=%d\n", WATCHDOG_MINOR); 434 431 goto no_misc; 435 432 } 436 433
+10 -15
drivers/watchdog/mixcomwd.c
··· 39 39 * 40 40 */ 41 41 42 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 43 + 42 44 #define VERSION "0.6" 43 45 #define WATCHDOG_NAME "mixcomwd" 44 - #define PFX WATCHDOG_NAME ": " 45 46 46 47 #include <linux/module.h> 47 48 #include <linux/moduleparam.h> ··· 157 156 { 158 157 if (expect_close == 42) { 159 158 if (mixcomwd_timer_alive) { 160 - printk(KERN_ERR PFX 161 - "release called while internal timer alive"); 159 + pr_err("release called while internal timer alive\n"); 162 160 return -EBUSY; 163 161 } 164 162 mixcomwd_timer_alive = 1; 165 163 mod_timer(&mixcomwd_timer, jiffies + 5 * HZ); 166 164 } else 167 - printk(KERN_CRIT PFX 168 - "WDT device closed unexpectedly. WDT will not stop!\n"); 165 + pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); 169 166 170 167 clear_bit(0, &mixcomwd_opened); 171 168 expect_close = 0; ··· 273 274 } 274 275 275 276 if (!found) { 276 - printk(KERN_ERR PFX 277 - "No card detected, or port not available.\n"); 277 + pr_err("No card detected, or port not available\n"); 278 278 return -ENODEV; 279 279 } 280 280 281 281 ret = misc_register(&mixcomwd_miscdev); 282 282 if (ret) { 283 - printk(KERN_ERR PFX 284 - "cannot register miscdev on minor=%d (err=%d)\n", 285 - WATCHDOG_MINOR, ret); 283 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 284 + WATCHDOG_MINOR, ret); 286 285 goto error_misc_register_watchdog; 287 286 } 288 287 289 - printk(KERN_INFO 290 - "MixCOM watchdog driver v%s, watchdog port at 0x%3x\n", 291 - VERSION, watchdog_port); 288 + pr_info("MixCOM watchdog driver v%s, watchdog port at 0x%3x\n", 289 + VERSION, watchdog_port); 292 290 293 291 return 0; 294 292 ··· 299 303 { 300 304 if (!nowayout) { 301 305 if (mixcomwd_timer_alive) { 302 - printk(KERN_WARNING PFX "I quit now, hardware will" 303 - " probably reboot!\n"); 306 + pr_warn("I quit now, hardware will probably reboot!\n"); 304 307 del_timer_sync(&mixcomwd_timer); 305 308 mixcomwd_timer_alive = 0; 306 309 }
+7 -6
drivers/watchdog/mpc8xxx_wdt.c
··· 17 17 * option) any later version. 18 18 */ 19 19 20 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 + 20 22 #include <linux/fs.h> 21 23 #include <linux/init.h> 22 24 #include <linux/kernel.h> ··· 98 96 99 97 static void mpc8xxx_wdt_pr_warn(const char *msg) 100 98 { 101 - pr_crit("mpc8xxx_wdt: %s, expect the %s soon!\n", msg, 99 + pr_crit("%s, expect the %s soon!\n", msg, 102 100 reset ? "reset" : "machine check exception"); 103 101 } 104 102 ··· 211 209 212 210 enabled = in_be32(&wd_base->swcrr) & SWCRR_SWEN; 213 211 if (!enabled && wdt_type->hw_enabled) { 214 - pr_info("mpc8xxx_wdt: could not be enabled in software\n"); 212 + pr_info("could not be enabled in software\n"); 215 213 ret = -ENOSYS; 216 214 goto err_unmap; 217 215 } ··· 228 226 goto err_unmap; 229 227 #endif 230 228 231 - pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d " 232 - "(%d seconds)\n", reset ? "reset" : "interrupt", timeout, 233 - timeout_sec); 229 + pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d (%d seconds)\n", 230 + reset ? "reset" : "interrupt", timeout, timeout_sec); 234 231 235 232 /* 236 233 * If the watchdog was previously enabled or we're running on ··· 304 303 ret = misc_register(&mpc8xxx_wdt_miscdev); 305 304 if (ret) { 306 305 pr_err("cannot register miscdev on minor=%d (err=%d)\n", 307 - WATCHDOG_MINOR, ret); 306 + WATCHDOG_MINOR, ret); 308 307 return ret; 309 308 } 310 309 return 0;
+6 -5
drivers/watchdog/mpcore_wdt.c
··· 19 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 25 #include <linux/module.h> 23 26 #include <linux/moduleparam.h> 24 27 #include <linux/types.h> ··· 445 442 }, 446 443 }; 447 444 448 - static char banner[] __initdata = KERN_INFO "MPcore Watchdog Timer: 0.1. " 449 - "mpcore_noboot=%d mpcore_margin=%d sec (nowayout= %d)\n"; 450 - 451 445 static int __init mpcore_wdt_init(void) 452 446 { 453 447 /* ··· 453 453 */ 454 454 if (mpcore_wdt_set_heartbeat(mpcore_margin)) { 455 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 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 463 return platform_driver_register(&mpcore_wdt_driver); 463 464 }
+6 -5
drivers/watchdog/mv64x60_wdt.c
··· 15 15 * or implied. 16 16 */ 17 17 18 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 19 + 18 20 #include <linux/fs.h> 19 21 #include <linux/init.h> 20 22 #include <linux/kernel.h> ··· 102 100 if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_FALSE, 103 101 MV64x60_WDC_ENABLE_SHIFT)) { 104 102 mv64x60_wdt_service(); 105 - printk(KERN_NOTICE "mv64x60_wdt: watchdog activated\n"); 103 + pr_notice("watchdog activated\n"); 106 104 } 107 105 } 108 106 ··· 110 108 { 111 109 if (mv64x60_wdt_toggle_wdc(MV64x60_WDC_ENABLED_TRUE, 112 110 MV64x60_WDC_ENABLE_SHIFT)) 113 - printk(KERN_NOTICE "mv64x60_wdt: watchdog deactivated\n"); 111 + pr_notice("watchdog deactivated\n"); 114 112 } 115 113 116 114 static void mv64x60_wdt_set_timeout(unsigned int timeout) ··· 141 139 if (expect_close == 42) 142 140 mv64x60_wdt_handler_disable(); 143 141 else { 144 - printk(KERN_CRIT 145 - "mv64x60_wdt: unexpected close, not stopping timer!\n"); 142 + pr_crit("unexpected close, not stopping timer!\n"); 146 143 mv64x60_wdt_service(); 147 144 } 148 145 expect_close = 0; ··· 309 308 310 309 static int __init mv64x60_wdt_init(void) 311 310 { 312 - printk(KERN_INFO "MV64x60 watchdog driver\n"); 311 + pr_info("MV64x60 watchdog driver\n"); 313 312 314 313 return platform_driver_register(&mv64x60_wdt_driver); 315 314 }
+19 -23
drivers/watchdog/nv_tco.c
··· 21 21 * Includes, defines, variables, module parameters, ... 22 22 */ 23 23 24 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 25 + 24 26 #include <linux/module.h> 25 27 #include <linux/moduleparam.h> 26 28 #include <linux/types.h> ··· 43 41 #define TCO_VERSION "0.01" 44 42 #define TCO_MODULE_NAME "NV_TCO" 45 43 #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION 46 - #define PFX TCO_MODULE_NAME ": " 47 44 48 45 /* internal variables */ 49 46 static unsigned int tcobase; ··· 170 169 if (tco_expect_close == 42) { 171 170 tco_timer_stop(); 172 171 } else { 173 - printk(KERN_CRIT PFX "Unexpected close, not stopping " 174 - "watchdog!\n"); 172 + pr_crit("Unexpected close, not stopping watchdog!\n"); 175 173 tco_timer_keepalive(); 176 174 } 177 175 clear_bit(0, &timer_alive); ··· 323 323 val &= 0xffff; 324 324 if (val == 0x0001 || val == 0x0000) { 325 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 327 return 0; 328 328 } 329 329 val &= 0xff00; 330 330 tcobase = val + 0x40; 331 331 332 332 if (!request_region(tcobase, 0x10, "NV TCO")) { 333 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 334 - tcobase); 333 + pr_err("I/O address 0x%04x already in use\n", tcobase); 335 334 return 0; 336 335 } 337 336 ··· 346 347 347 348 /* Disable SMI caused by TCO */ 348 349 if (!request_region(MCP51_SMI_EN(tcobase), 4, "NV TCO")) { 349 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 350 + pr_err("I/O address 0x%04x already in use\n", 350 351 MCP51_SMI_EN(tcobase)); 351 352 goto out; 352 353 } ··· 356 357 val = inl(MCP51_SMI_EN(tcobase)); 357 358 release_region(MCP51_SMI_EN(tcobase), 4); 358 359 if (val & MCP51_SMI_EN_TCO) { 359 - printk(KERN_ERR PFX "Could not disable SMI caused by TCO\n"); 360 + pr_err("Could not disable SMI caused by TCO\n"); 360 361 goto out; 361 362 } 362 363 ··· 366 367 pci_write_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, val); 367 368 pci_read_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, &val); 368 369 if (!(val & MCP51_SMBUS_SETUP_B_TCO_REBOOT)) { 369 - printk(KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot " 370 - "disabled by hardware\n"); 370 + pr_err("failed to reset NO_REBOOT flag, reboot disabled by hardware\n"); 371 371 goto out; 372 372 } 373 373 ··· 385 387 return -ENODEV; 386 388 387 389 /* Check to see if last reboot was due to watchdog timeout */ 388 - printk(KERN_INFO PFX "Watchdog reboot %sdetected.\n", 389 - inl(TCO_STS(tcobase)) & TCO_STS_TCO2TO_STS ? "" : "not "); 390 + pr_info("Watchdog reboot %sdetected\n", 391 + inl(TCO_STS(tcobase)) & TCO_STS_TCO2TO_STS ? "" : "not "); 390 392 391 393 /* Clear out the old status */ 392 394 outl(TCO_STS_RESET, TCO_STS(tcobase)); ··· 398 400 if (tco_timer_set_heartbeat(heartbeat)) { 399 401 heartbeat = WATCHDOG_HEARTBEAT; 400 402 tco_timer_set_heartbeat(heartbeat); 401 - printk(KERN_INFO PFX "heartbeat value must be 2<heartbeat<39, " 402 - "using %d\n", heartbeat); 403 + pr_info("heartbeat value must be 2<heartbeat<39, using %d\n", 404 + heartbeat); 403 405 } 404 406 405 407 ret = misc_register(&nv_tco_miscdev); 406 408 if (ret != 0) { 407 - printk(KERN_ERR PFX "cannot register miscdev on minor=%d " 408 - "(err=%d)\n", WATCHDOG_MINOR, ret); 409 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 410 + WATCHDOG_MINOR, ret); 409 411 goto unreg_region; 410 412 } 411 413 ··· 413 415 414 416 tco_timer_stop(); 415 417 416 - printk(KERN_INFO PFX "initialized (0x%04x). heartbeat=%d sec " 417 - "(nowayout=%d)\n", tcobase, heartbeat, nowayout); 418 + pr_info("initialized (0x%04x). heartbeat=%d sec (nowayout=%d)\n", 419 + tcobase, heartbeat, nowayout); 418 420 419 421 return 0; 420 422 ··· 437 439 pci_write_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, val); 438 440 pci_read_config_dword(tco_pci, MCP51_SMBUS_SETUP_B, &val); 439 441 if (val & MCP51_SMBUS_SETUP_B_TCO_REBOOT) { 440 - printk(KERN_CRIT PFX "Couldn't unset REBOOT bit. Machine may " 441 - "soon reset\n"); 442 + pr_crit("Couldn't unset REBOOT bit. Machine may soon reset\n"); 442 443 } 443 444 444 445 /* Deregister */ ··· 480 483 { 481 484 int err; 482 485 483 - printk(KERN_INFO PFX "NV TCO WatchDog Timer Driver v%s\n", 484 - TCO_VERSION); 486 + pr_info("NV TCO WatchDog Timer Driver v%s\n", TCO_VERSION); 485 487 486 488 err = platform_driver_register(&nv_tco_driver); 487 489 if (err) ··· 504 508 { 505 509 platform_device_unregister(nv_tco_platform_device); 506 510 platform_driver_unregister(&nv_tco_driver); 507 - printk(KERN_INFO PFX "NV TCO Watchdog Module Unloaded.\n"); 511 + pr_info("NV TCO Watchdog Module Unloaded\n"); 508 512 } 509 513 510 514 module_init(nv_tco_init_module);
+7 -5
drivers/watchdog/octeon-wdt-main.c
··· 52 52 * 53 53 */ 54 54 55 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 56 + 55 57 #include <linux/miscdevice.h> 56 58 #include <linux/interrupt.h> 57 59 #include <linux/watchdog.h> ··· 203 201 uasm_resolve_relocs(relocs, labels); 204 202 205 203 len = (int)(p - nmi_stage1_insns); 206 - pr_debug("Synthesized NMI stage 1 handler (%d instructions).\n", len); 204 + pr_debug("Synthesized NMI stage 1 handler (%d instructions)\n", len); 207 205 208 206 pr_debug("\t.set push\n"); 209 207 pr_debug("\t.set noreorder\n"); ··· 629 627 do_coundown = 0; 630 628 octeon_wdt_ping(); 631 629 } else { 632 - pr_crit("octeon_wdt: WDT device closed unexpectedly. WDT will not stop!\n"); 630 + pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); 633 631 } 634 632 clear_bit(0, &octeon_wdt_is_open); 635 633 expect_close = 0; ··· 686 684 687 685 octeon_wdt_calc_parameters(heartbeat); 688 686 689 - pr_info("octeon_wdt: Initial granularity %d Sec.\n", timeout_sec); 687 + pr_info("Initial granularity %d Sec\n", timeout_sec); 690 688 691 689 ret = misc_register(&octeon_wdt_miscdev); 692 690 if (ret) { 693 - pr_err("octeon_wdt: cannot register miscdev on minor=%d (err=%d)\n", 694 - WATCHDOG_MINOR, ret); 691 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 692 + WATCHDOG_MINOR, ret); 695 693 goto out; 696 694 } 697 695
+18 -23
drivers/watchdog/of_xilinx_wdt.c
··· 19 19 * know the wdt reset interval 20 20 */ 21 21 22 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 23 + 22 24 #include <linux/module.h> 23 25 #include <linux/types.h> 24 26 #include <linux/kernel.h> ··· 101 99 iowrite32(0, xdev.base + XWT_TWCSR1_OFFSET); 102 100 103 101 spin_unlock(&spinlock); 104 - printk(KERN_INFO PFX "Stopped!\n"); 102 + pr_info("Stopped!\n"); 105 103 } 106 104 107 105 static void xwdt_keepalive(void) ··· 167 165 __module_get(THIS_MODULE); 168 166 169 167 xwdt_start(); 170 - printk(KERN_INFO PFX "Started...\n"); 168 + pr_info("Started...\n"); 171 169 172 170 return nonseekable_open(inode, file); 173 171 } ··· 177 175 if (expect_close == 42) { 178 176 xwdt_stop(); 179 177 } else { 180 - printk(KERN_CRIT PFX 181 - "Unexpected close, not stopping watchdog!\n"); 178 + pr_crit("Unexpected close, not stopping watchdog!\n"); 182 179 xwdt_keepalive(); 183 180 } 184 181 ··· 301 300 "clock-frequency", NULL); 302 301 303 302 if (pfreq == NULL) { 304 - printk(KERN_WARNING PFX 305 - "The watchdog clock frequency cannot be obtained!\n"); 303 + pr_warn("The watchdog clock frequency cannot be obtained!\n"); 306 304 no_timeout = 1; 307 305 } 308 306 309 307 rc = of_address_to_resource(pdev->dev.of_node, 0, &xdev.res); 310 308 if (rc) { 311 - printk(KERN_WARNING PFX "invalid address!\n"); 309 + pr_warn("invalid address!\n"); 312 310 return rc; 313 311 } 314 312 315 313 tmptr = (u32 *)of_get_property(pdev->dev.of_node, 316 314 "xlnx,wdt-interval", NULL); 317 315 if (tmptr == NULL) { 318 - printk(KERN_WARNING PFX "Parameter \"xlnx,wdt-interval\"" 319 - " not found in device tree!\n"); 316 + pr_warn("Parameter \"xlnx,wdt-interval\" not found in device tree!\n"); 320 317 no_timeout = 1; 321 318 } else { 322 319 xdev.wdt_interval = *tmptr; ··· 323 324 tmptr = (u32 *)of_get_property(pdev->dev.of_node, 324 325 "xlnx,wdt-enable-once", NULL); 325 326 if (tmptr == NULL) { 326 - printk(KERN_WARNING PFX "Parameter \"xlnx,wdt-enable-once\"" 327 - " not found in device tree!\n"); 327 + pr_warn("Parameter \"xlnx,wdt-enable-once\" not found in device tree!\n"); 328 328 xdev.nowayout = WATCHDOG_NOWAYOUT; 329 329 } 330 330 ··· 337 339 if (!request_mem_region(xdev.res.start, 338 340 xdev.res.end - xdev.res.start + 1, WATCHDOG_NAME)) { 339 341 rc = -ENXIO; 340 - printk(KERN_ERR PFX "memory request failure!\n"); 342 + pr_err("memory request failure!\n"); 341 343 goto err_out; 342 344 } 343 345 344 346 xdev.base = ioremap(xdev.res.start, xdev.res.end - xdev.res.start + 1); 345 347 if (xdev.base == NULL) { 346 348 rc = -ENOMEM; 347 - printk(KERN_ERR PFX "ioremap failure!\n"); 349 + pr_err("ioremap failure!\n"); 348 350 goto release_mem; 349 351 } 350 352 351 353 rc = xwdt_selftest(); 352 354 if (rc == XWT_TIMER_FAILED) { 353 - printk(KERN_ERR PFX "SelfTest routine error!\n"); 355 + pr_err("SelfTest routine error!\n"); 354 356 goto unmap_io; 355 357 } 356 358 ··· 358 360 359 361 rc = misc_register(&xwdt_miscdev); 360 362 if (rc) { 361 - printk(KERN_ERR PFX 362 - "cannot register miscdev on minor=%d (err=%d)\n", 363 - xwdt_miscdev.minor, rc); 363 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 364 + xwdt_miscdev.minor, rc); 364 365 goto unmap_io; 365 366 } 366 367 367 368 if (no_timeout) 368 - printk(KERN_INFO PFX 369 - "driver loaded (timeout=? sec, nowayout=%d)\n", 370 - xdev.nowayout); 369 + pr_info("driver loaded (timeout=? sec, nowayout=%d)\n", 370 + xdev.nowayout); 371 371 else 372 - printk(KERN_INFO PFX 373 - "driver loaded (timeout=%d sec, nowayout=%d)\n", 374 - timeout, xdev.nowayout); 372 + pr_info("driver loaded (timeout=%d sec, nowayout=%d)\n", 373 + timeout, xdev.nowayout); 375 374 376 375 expect_close = 0; 377 376 clear_bit(0, &driver_open);
+3 -1
drivers/watchdog/omap_wdt.c
··· 26 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 31 #include <linux/module.h> 30 32 #include <linux/types.h> 31 33 #include <linux/kernel.h> ··· 185 183 186 184 pm_runtime_put_sync(wdev->dev); 187 185 #else 188 - printk(KERN_CRIT "omap_wdt: Unexpected close, not stopping!\n"); 186 + pr_crit("Unexpected close, not stopping!\n"); 189 187 #endif 190 188 wdev->omap_wdt_users = 0; 191 189
+6 -5
drivers/watchdog/orion_wdt.c
··· 10 10 * warranty of any kind, whether express or implied. 11 11 */ 12 12 13 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 14 + 13 15 #include <linux/module.h> 14 16 #include <linux/moduleparam.h> 15 17 #include <linux/types.h> ··· 211 209 if (test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 212 210 orion_wdt_disable(); 213 211 else 214 - printk(KERN_CRIT "WATCHDOG: Device closed unexpectedly - " 215 - "timer will not stop\n"); 212 + pr_crit("Device closed unexpectedly - timer will not stop\n"); 216 213 clear_bit(WDT_IN_USE, &wdt_status); 217 214 clear_bit(WDT_OK_TO_CLOSE, &wdt_status); 218 215 ··· 242 241 if (pdata) { 243 242 wdt_tclk = pdata->tclk; 244 243 } else { 245 - printk(KERN_ERR "Orion Watchdog misses platform data\n"); 244 + pr_err("misses platform data\n"); 246 245 return -ENODEV; 247 246 } 248 247 ··· 258 257 if (ret) 259 258 return ret; 260 259 261 - printk(KERN_INFO "Orion Watchdog Timer: Initial timeout %d sec%s\n", 262 - heartbeat, nowayout ? ", nowayout" : ""); 260 + pr_info("Initial timeout %d sec%s\n", 261 + heartbeat, nowayout ? ", nowayout" : ""); 263 262 return 0; 264 263 } 265 264
+24 -29
drivers/watchdog/pc87413_wdt.c
··· 18 18 * Release 1.1 19 19 */ 20 20 21 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22 + 21 23 #include <linux/module.h> 22 24 #include <linux/types.h> 23 25 #include <linux/miscdevice.h> ··· 44 42 45 43 #define VERSION "1.1" 46 44 #define MODNAME "pc87413 WDT" 47 - #define PFX MODNAME ": " 48 45 #define DPFX MODNAME " - DEBUG: " 49 46 50 47 #define WDT_INDEX_IO_PORT (io+0) /* I/O port base (index register) */ ··· 88 87 outb_p(cr_data, WDT_DATA_IO_PORT); 89 88 90 89 #ifdef DEBUG 91 - printk(KERN_INFO DPFX 90 + pr_info(DPFX 92 91 "Select multiple pin,pin55,as WDT output: Bit7 to 1: %d\n", 93 92 cr_data); 94 93 #endif ··· 112 111 outb_p(cr_data, WDT_DATA_IO_PORT); /* Index0x30_bit0P1 */ 113 112 114 113 #ifdef DEBUG 115 - printk(KERN_INFO DPFX "pc87413 - Enable SWC functions\n"); 114 + pr_info(DPFX "pc87413 - Enable SWC functions\n"); 116 115 #endif 117 116 } 118 117 ··· 133 132 134 133 swc_base_addr = (addr_h << 8) + addr_l; 135 134 #ifdef DEBUG 136 - printk(KERN_INFO DPFX 135 + pr_info(DPFX 137 136 "Read SWC I/O Base Address: low %d, high %d, res %d\n", 138 137 addr_l, addr_h, swc_base_addr); 139 138 #endif ··· 146 145 /* Step 4: Select Bank3 of SWC */ 147 146 outb_p(inb(swc_base_addr + 0x0f) | 0x03, swc_base_addr + 0x0f); 148 147 #ifdef DEBUG 149 - printk(KERN_INFO DPFX "Select Bank3 of SWC\n"); 148 + pr_info(DPFX "Select Bank3 of SWC\n"); 150 149 #endif 151 150 } 152 151 ··· 157 156 /* Step 5: Programm WDTO, Twd. */ 158 157 outb_p(pc87413_time, swc_base_addr + WDTO); 159 158 #ifdef DEBUG 160 - printk(KERN_INFO DPFX "Set WDTO to %d minutes\n", pc87413_time); 159 + pr_info(DPFX "Set WDTO to %d minutes\n", pc87413_time); 161 160 #endif 162 161 } 163 162 ··· 168 167 /* Step 6: Enable WDEN */ 169 168 outb_p(inb(swc_base_addr + WDCTL) | 0x01, swc_base_addr + WDCTL); 170 169 #ifdef DEBUG 171 - printk(KERN_INFO DPFX "Enable WDEN\n"); 170 + pr_info(DPFX "Enable WDEN\n"); 172 171 #endif 173 172 } 174 173 ··· 178 177 /* Enable SW_WD_TREN */ 179 178 outb_p(inb(swc_base_addr + WDCFG) | 0x80, swc_base_addr + WDCFG); 180 179 #ifdef DEBUG 181 - printk(KERN_INFO DPFX "Enable SW_WD_TREN\n"); 180 + pr_info(DPFX "Enable SW_WD_TREN\n"); 182 181 #endif 183 182 } 184 183 ··· 189 188 /* Disable SW_WD_TREN */ 190 189 outb_p(inb(swc_base_addr + WDCFG) & 0x7f, swc_base_addr + WDCFG); 191 190 #ifdef DEBUG 192 - printk(KERN_INFO DPFX "pc87413 - Disable SW_WD_TREN\n"); 191 + pr_info(DPFX "pc87413 - Disable SW_WD_TREN\n"); 193 192 #endif 194 193 } 195 194 ··· 200 199 /* Enable SW_WD_TRG */ 201 200 outb_p(inb(swc_base_addr + WDCTL) | 0x80, swc_base_addr + WDCTL); 202 201 #ifdef DEBUG 203 - printk(KERN_INFO DPFX "pc87413 - Enable SW_WD_TRG\n"); 202 + pr_info(DPFX "pc87413 - Enable SW_WD_TRG\n"); 204 203 #endif 205 204 } 206 205 ··· 211 210 /* Disable SW_WD_TRG */ 212 211 outb_p(inb(swc_base_addr + WDCTL) & 0x7f, swc_base_addr + WDCTL); 213 212 #ifdef DEBUG 214 - printk(KERN_INFO DPFX "Disable SW_WD_TRG\n"); 213 + pr_info(DPFX "Disable SW_WD_TRG\n"); 215 214 #endif 216 215 } 217 216 ··· 285 284 /* Reload and activate timer */ 286 285 pc87413_refresh(); 287 286 288 - printk(KERN_INFO MODNAME 289 - "Watchdog enabled. Timeout set to %d minute(s).\n", timeout); 287 + pr_info("Watchdog enabled. Timeout set to %d minute(s).\n", timeout); 290 288 291 289 return nonseekable_open(inode, file); 292 290 } ··· 308 308 309 309 if (expect_close == 42) { 310 310 pc87413_disable(); 311 - printk(KERN_INFO MODNAME 312 - "Watchdog disabled, sleeping again...\n"); 311 + pr_info("Watchdog disabled, sleeping again...\n"); 313 312 } else { 314 - printk(KERN_CRIT MODNAME 315 - "Unexpected close, not stopping watchdog!\n"); 313 + pr_crit("Unexpected close, not stopping watchdog!\n"); 316 314 pc87413_refresh(); 317 315 } 318 316 clear_bit(0, &timer_enabled); ··· 426 428 case WDIOC_KEEPALIVE: 427 429 pc87413_refresh(); 428 430 #ifdef DEBUG 429 - printk(KERN_INFO DPFX "keepalive\n"); 431 + pr_info(DPFX "keepalive\n"); 430 432 #endif 431 433 return 0; 432 434 case WDIOC_SETTIMEOUT: ··· 506 508 { 507 509 int ret; 508 510 509 - printk(KERN_INFO PFX "Version " VERSION " at io 0x%X\n", 511 + pr_info("Version " VERSION " at io 0x%X\n", 510 512 WDT_INDEX_IO_PORT); 511 513 512 514 if (!request_muxed_region(io, 2, MODNAME)) ··· 514 516 515 517 ret = register_reboot_notifier(&pc87413_notifier); 516 518 if (ret != 0) { 517 - printk(KERN_ERR PFX 518 - "cannot register reboot notifier (err=%d)\n", ret); 519 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 519 520 } 520 521 521 522 ret = misc_register(&pc87413_miscdev); 522 523 if (ret != 0) { 523 - printk(KERN_ERR PFX 524 - "cannot register miscdev on minor=%d (err=%d)\n", 525 - WATCHDOG_MINOR, ret); 524 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 525 + WATCHDOG_MINOR, ret); 526 526 goto reboot_unreg; 527 527 } 528 - printk(KERN_INFO PFX "initialized. timeout=%d min \n", timeout); 528 + pr_info("initialized. timeout=%d min\n", timeout); 529 529 530 530 pc87413_select_wdt_out(); 531 531 pc87413_enable_swc(); 532 532 pc87413_get_swc_base_addr(); 533 533 534 534 if (!request_region(swc_base_addr, 0x20, MODNAME)) { 535 - printk(KERN_ERR PFX 536 - "cannot request SWC region at 0x%x\n", swc_base_addr); 535 + pr_err("cannot request SWC region at 0x%x\n", swc_base_addr); 537 536 ret = -EBUSY; 538 537 goto misc_unreg; 539 538 } ··· 563 568 /* Stop the timer before we leave */ 564 569 if (!nowayout) { 565 570 pc87413_disable(); 566 - printk(KERN_INFO MODNAME "Watchdog disabled.\n"); 571 + pr_info("Watchdog disabled\n"); 567 572 } 568 573 569 574 misc_deregister(&pc87413_miscdev); 570 575 unregister_reboot_notifier(&pc87413_notifier); 571 576 release_region(swc_base_addr, 0x20); 572 577 573 - printk(KERN_INFO MODNAME " watchdog component driver removed.\n"); 578 + pr_info("watchdog component driver removed\n"); 574 579 } 575 580 576 581 module_init(pc87413_init);
+49 -74
drivers/watchdog/pcwd.c
··· 51 51 * http://www.pcwatchdog.com/ 52 52 */ 53 53 54 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 55 + 54 56 #include <linux/module.h> /* For module specific items */ 55 57 #include <linux/moduleparam.h> /* For new moduleparam's */ 56 58 #include <linux/types.h> /* For standard types (like size_t) */ ··· 77 75 #define WATCHDOG_DATE "18 Feb 2007" 78 76 #define WATCHDOG_DRIVER_NAME "ISA-PC Watchdog" 79 77 #define WATCHDOG_NAME "pcwd" 80 - #define PFX WATCHDOG_NAME ": " 81 78 #define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n" 82 79 83 80 /* ··· 221 220 int port0, last_port0; /* Double read for stabilising */ 222 221 223 222 if (debug >= DEBUG) 224 - printk(KERN_DEBUG PFX "sending following data cmd=0x%02x\n", 225 - cmd); 223 + pr_debug("sending following data cmd=0x%02x\n", cmd); 226 224 227 225 /* The WCMD bit must be 1 and the command is only 4 bits in size */ 228 226 control_status = (cmd & 0x0F) | WD_WCMD; ··· 240 240 } 241 241 242 242 if (debug >= DEBUG) 243 - printk(KERN_DEBUG PFX "received following data for " 244 - "cmd=0x%02x: port0=0x%02x last_port0=0x%02x\n", 245 - cmd, port0, last_port0); 243 + pr_debug("received following data for cmd=0x%02x: port0=0x%02x last_port0=0x%02x\n", 244 + cmd, port0, last_port0); 246 245 247 246 return port0; 248 247 } ··· 270 271 pcwd_private.command_mode = found; 271 272 272 273 if (debug >= DEBUG) 273 - printk(KERN_DEBUG PFX "command_mode=%d\n", 274 - pcwd_private.command_mode); 274 + pr_debug("command_mode=%d\n", pcwd_private.command_mode); 275 275 276 276 return found; 277 277 } ··· 286 288 pcwd_private.command_mode = 0; 287 289 288 290 if (debug >= DEBUG) 289 - printk(KERN_DEBUG PFX "command_mode=%d\n", 290 - pcwd_private.command_mode); 291 + pr_debug("command_mode=%d\n", pcwd_private.command_mode); 291 292 } 292 293 293 294 static inline void pcwd_check_temperature_support(void) ··· 333 336 334 337 /* Get some extra info from the hardware (in command/debug/diag mode) */ 335 338 if (pcwd_private.revision == PCWD_REVISION_A) 336 - printk(KERN_INFO PFX 337 - "ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", 338 - pcwd_private.io_addr); 339 + pr_info("ISA-PC Watchdog (REV.A) detected at port 0x%04x\n", 340 + pcwd_private.io_addr); 339 341 else if (pcwd_private.revision == PCWD_REVISION_C) { 340 342 pcwd_get_firmware(); 341 - printk(KERN_INFO PFX "ISA-PC Watchdog (REV.C) detected at port " 342 - "0x%04x (Firmware version: %s)\n", 343 + pr_info("ISA-PC Watchdog (REV.C) detected at port 0x%04x (Firmware version: %s)\n", 343 344 pcwd_private.io_addr, pcwd_private.fw_ver_str); 344 345 option_switches = pcwd_get_option_switches(); 345 - printk(KERN_INFO PFX "Option switches (0x%02x): " 346 - "Temperature Reset Enable=%s, Power On Delay=%s\n", 346 + pr_info("Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", 347 347 option_switches, 348 348 ((option_switches & 0x10) ? "ON" : "OFF"), 349 349 ((option_switches & 0x08) ? "ON" : "OFF")); ··· 353 359 } 354 360 355 361 if (pcwd_private.supports_temp) 356 - printk(KERN_INFO PFX "Temperature Option Detected\n"); 362 + pr_info("Temperature Option Detected\n"); 357 363 358 364 if (pcwd_private.boot_status & WDIOF_CARDRESET) 359 - printk(KERN_INFO PFX 360 - "Previous reboot was caused by the card\n"); 365 + pr_info("Previous reboot was caused by the card\n"); 361 366 362 367 if (pcwd_private.boot_status & WDIOF_OVERHEAT) { 363 - printk(KERN_EMERG PFX 364 - "Card senses a CPU Overheat. Panicking!\n"); 365 - printk(KERN_EMERG PFX 366 - "CPU Overheat\n"); 368 + pr_emerg("Card senses a CPU Overheat. Panicking!\n"); 369 + pr_emerg("CPU Overheat\n"); 367 370 } 368 371 369 372 if (pcwd_private.boot_status == 0) 370 - printk(KERN_INFO PFX 371 - "No previous trip detected - Cold boot or reset\n"); 373 + pr_info("No previous trip detected - Cold boot or reset\n"); 372 374 } 373 375 374 376 static void pcwd_timer_ping(unsigned long data) ··· 394 404 395 405 spin_unlock(&pcwd_private.io_lock); 396 406 } else { 397 - printk(KERN_WARNING PFX 398 - "Heartbeat lost! Will not ping the watchdog\n"); 407 + pr_warn("Heartbeat lost! Will not ping the watchdog\n"); 399 408 } 400 409 } 401 410 ··· 415 426 stat_reg = inb_p(pcwd_private.io_addr + 2); 416 427 spin_unlock(&pcwd_private.io_lock); 417 428 if (stat_reg & WD_WDIS) { 418 - printk(KERN_INFO PFX "Could not start watchdog\n"); 429 + pr_info("Could not start watchdog\n"); 419 430 return -EIO; 420 431 } 421 432 } 422 433 423 434 if (debug >= VERBOSE) 424 - printk(KERN_DEBUG PFX "Watchdog started\n"); 435 + pr_debug("Watchdog started\n"); 425 436 426 437 return 0; 427 438 } ··· 443 454 stat_reg = inb_p(pcwd_private.io_addr + 2); 444 455 spin_unlock(&pcwd_private.io_lock); 445 456 if ((stat_reg & WD_WDIS) == 0) { 446 - printk(KERN_INFO PFX "Could not stop watchdog\n"); 457 + pr_info("Could not stop watchdog\n"); 447 458 return -EIO; 448 459 } 449 460 } 450 461 451 462 if (debug >= VERBOSE) 452 - printk(KERN_DEBUG PFX "Watchdog stopped\n"); 463 + pr_debug("Watchdog stopped\n"); 453 464 454 465 return 0; 455 466 } ··· 460 471 pcwd_private.next_heartbeat = jiffies + (heartbeat * HZ); 461 472 462 473 if (debug >= DEBUG) 463 - printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n"); 474 + pr_debug("Watchdog keepalive signal send\n"); 464 475 465 476 return 0; 466 477 } ··· 473 484 heartbeat = t; 474 485 475 486 if (debug >= VERBOSE) 476 - printk(KERN_DEBUG PFX "New heartbeat: %d\n", 477 - heartbeat); 487 + pr_debug("New heartbeat: %d\n", heartbeat); 478 488 479 489 return 0; 480 490 } ··· 506 518 if (control_status & WD_T110) { 507 519 *status |= WDIOF_OVERHEAT; 508 520 if (temp_panic) { 509 - printk(KERN_INFO PFX 510 - "Temperature overheat trip!\n"); 521 + pr_info("Temperature overheat trip!\n"); 511 522 kernel_power_off(); 512 523 } 513 524 } ··· 517 530 if (control_status & WD_REVC_TTRP) { 518 531 *status |= WDIOF_OVERHEAT; 519 532 if (temp_panic) { 520 - printk(KERN_INFO PFX 521 - "Temperature overheat trip!\n"); 533 + pr_info("Temperature overheat trip!\n"); 522 534 kernel_power_off(); 523 535 } 524 536 } ··· 534 548 spin_lock(&pcwd_private.io_lock); 535 549 536 550 if (debug >= VERBOSE) 537 - printk(KERN_INFO PFX 538 - "clearing watchdog trip status\n"); 551 + pr_info("clearing watchdog trip status\n"); 539 552 540 553 control_status = inb_p(pcwd_private.io_addr + 1); 541 554 542 555 if (debug >= DEBUG) { 543 - printk(KERN_DEBUG PFX "status was: 0x%02x\n", 544 - control_status); 545 - printk(KERN_DEBUG PFX "sending: 0x%02x\n", 546 - (control_status & WD_REVC_R2DS)); 556 + pr_debug("status was: 0x%02x\n", control_status); 557 + pr_debug("sending: 0x%02x\n", 558 + (control_status & WD_REVC_R2DS)); 547 559 } 548 560 549 561 /* clear reset status & Keep Relay 2 disable state as it is */ ··· 572 588 spin_unlock(&pcwd_private.io_lock); 573 589 574 590 if (debug >= DEBUG) { 575 - printk(KERN_DEBUG PFX "temperature is: %d F\n", 576 - *temperature); 591 + pr_debug("temperature is: %d F\n", *temperature); 577 592 } 578 593 579 594 return 0; ··· 703 720 if (expect_close == 42) 704 721 pcwd_stop(); 705 722 else { 706 - printk(KERN_CRIT PFX 707 - "Unexpected close, not stopping watchdog!\n"); 723 + pr_crit("Unexpected close, not stopping watchdog!\n"); 708 724 pcwd_keepalive(); 709 725 } 710 726 expect_close = 0; ··· 810 828 int retval; 811 829 812 830 if (debug >= DEBUG) 813 - printk(KERN_DEBUG PFX "pcwd_isa_match id=%d\n", 814 - id); 831 + pr_debug("pcwd_isa_match id=%d\n", id); 815 832 816 833 if (!request_region(base_addr, 4, "PCWD")) { 817 - printk(KERN_INFO PFX "Port 0x%04x unavailable\n", base_addr); 834 + pr_info("Port 0x%04x unavailable\n", base_addr); 818 835 return 0; 819 836 } 820 837 ··· 851 870 int ret; 852 871 853 872 if (debug >= DEBUG) 854 - printk(KERN_DEBUG PFX "pcwd_isa_probe id=%d\n", 855 - id); 873 + pr_debug("pcwd_isa_probe id=%d\n", id); 856 874 857 875 cards_found++; 858 876 if (cards_found == 1) 859 - printk(KERN_INFO PFX "v%s Ken Hollis (kenji@bitgate.com)\n", 877 + pr_info("v%s Ken Hollis (kenji@bitgate.com)\n", 860 878 WATCHDOG_VERSION); 861 879 862 880 if (cards_found > 1) { 863 - printk(KERN_ERR PFX "This driver only supports 1 device\n"); 881 + pr_err("This driver only supports 1 device\n"); 864 882 return -ENODEV; 865 883 } 866 884 867 885 if (pcwd_ioports[id] == 0x0000) { 868 - printk(KERN_ERR PFX "No I/O-Address for card detected\n"); 886 + pr_err("No I/O-Address for card detected\n"); 869 887 return -ENODEV; 870 888 } 871 889 pcwd_private.io_addr = pcwd_ioports[id]; ··· 876 896 877 897 if (!request_region(pcwd_private.io_addr, 878 898 (pcwd_private.revision == PCWD_REVISION_A) ? 2 : 4, "PCWD")) { 879 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 880 - pcwd_private.io_addr); 899 + pr_err("I/O address 0x%04x already in use\n", 900 + pcwd_private.io_addr); 881 901 ret = -EIO; 882 902 goto error_request_region; 883 903 } ··· 912 932 if not reset to the default */ 913 933 if (pcwd_set_heartbeat(heartbeat)) { 914 934 pcwd_set_heartbeat(WATCHDOG_HEARTBEAT); 915 - printk(KERN_INFO PFX 916 - "heartbeat value must be 2 <= heartbeat <= 7200, using %d\n", 917 - WATCHDOG_HEARTBEAT); 935 + pr_info("heartbeat value must be 2 <= heartbeat <= 7200, using %d\n", 936 + WATCHDOG_HEARTBEAT); 918 937 } 919 938 920 939 if (pcwd_private.supports_temp) { 921 940 ret = misc_register(&temp_miscdev); 922 941 if (ret) { 923 - printk(KERN_ERR PFX 924 - "cannot register miscdev on minor=%d (err=%d)\n", 925 - TEMP_MINOR, ret); 942 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 943 + TEMP_MINOR, ret); 926 944 goto error_misc_register_temp; 927 945 } 928 946 } 929 947 930 948 ret = misc_register(&pcwd_miscdev); 931 949 if (ret) { 932 - printk(KERN_ERR PFX 933 - "cannot register miscdev on minor=%d (err=%d)\n", 934 - WATCHDOG_MINOR, ret); 950 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 951 + WATCHDOG_MINOR, ret); 935 952 goto error_misc_register_watchdog; 936 953 } 937 954 938 - printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", 955 + pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", 939 956 heartbeat, nowayout); 940 957 941 958 return 0; ··· 952 975 static int __devexit pcwd_isa_remove(struct device *dev, unsigned int id) 953 976 { 954 977 if (debug >= DEBUG) 955 - printk(KERN_DEBUG PFX "pcwd_isa_remove id=%d\n", 956 - id); 978 + pr_debug("pcwd_isa_remove id=%d\n", id); 957 979 958 980 if (!pcwd_private.io_addr) 959 981 return 1; ··· 976 1000 static void pcwd_isa_shutdown(struct device *dev, unsigned int id) 977 1001 { 978 1002 if (debug >= DEBUG) 979 - printk(KERN_DEBUG PFX "pcwd_isa_shutdown id=%d\n", 980 - id); 1003 + pr_debug("pcwd_isa_shutdown id=%d\n", id); 981 1004 982 1005 pcwd_stop(); 983 1006 } ··· 1000 1025 static void __exit pcwd_cleanup_module(void) 1001 1026 { 1002 1027 isa_unregister_driver(&pcwd_isa_driver); 1003 - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); 1028 + pr_info("Watchdog Module Unloaded\n"); 1004 1029 } 1005 1030 1006 1031 module_init(pcwd_init_module);
+46 -63
drivers/watchdog/pcwd_pci.c
··· 32 32 * Includes, defines, variables, module parameters, ... 33 33 */ 34 34 35 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 36 + 35 37 #include <linux/module.h> /* For module specific items */ 36 38 #include <linux/moduleparam.h> /* For new moduleparam's */ 37 39 #include <linux/types.h> /* For standard types (like size_t) */ ··· 56 54 #define WATCHDOG_VERSION "1.03" 57 55 #define WATCHDOG_DRIVER_NAME "PCI-PC Watchdog" 58 56 #define WATCHDOG_NAME "pcwd_pci" 59 - #define PFX WATCHDOG_NAME ": " 60 - #define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION "\n" 57 + #define DRIVER_VERSION WATCHDOG_DRIVER_NAME " driver, v" WATCHDOG_VERSION 61 58 62 59 /* Stuff for the PCI ID's */ 63 60 #ifndef PCI_VENDOR_ID_QUICKLOGIC ··· 160 159 int got_response, count; 161 160 162 161 if (debug >= DEBUG) 163 - printk(KERN_DEBUG PFX "sending following data " 164 - "cmd=0x%02x msb=0x%02x lsb=0x%02x\n", cmd, *msb, *lsb); 162 + pr_debug("sending following data cmd=0x%02x msb=0x%02x lsb=0x%02x\n", 163 + cmd, *msb, *lsb); 165 164 166 165 spin_lock(&pcipcwd_private.io_lock); 167 166 /* If a command requires data it should be written first. ··· 186 185 187 186 if (debug >= DEBUG) { 188 187 if (got_response) { 189 - printk(KERN_DEBUG PFX 190 - "time to process command was: %d ms\n", 191 - count); 188 + pr_debug("time to process command was: %d ms\n", 189 + count); 192 190 } else { 193 - printk(KERN_DEBUG PFX 194 - "card did not respond on command!\n"); 191 + pr_debug("card did not respond on command!\n"); 195 192 } 196 193 } 197 194 ··· 202 203 inb_p(pcipcwd_private.io_addr + 6); 203 204 204 205 if (debug >= DEBUG) 205 - printk(KERN_DEBUG PFX "received following data for " 206 - "cmd=0x%02x: msb=0x%02x lsb=0x%02x\n", 207 - cmd, *msb, *lsb); 206 + pr_debug("received following data for cmd=0x%02x: msb=0x%02x lsb=0x%02x\n", 207 + cmd, *msb, *lsb); 208 208 } 209 209 210 210 spin_unlock(&pcipcwd_private.io_lock); ··· 241 243 /* Get switch settings */ 242 244 option_switches = pcipcwd_get_option_switches(); 243 245 244 - printk(KERN_INFO PFX "Found card at port " 245 - "0x%04x (Firmware: %s) %s temp option\n", 246 + pr_info("Found card at port 0x%04x (Firmware: %s) %s temp option\n", 246 247 (int) pcipcwd_private.io_addr, fw_ver_str, 247 248 (pcipcwd_private.supports_temp ? "with" : "without")); 248 249 249 - printk(KERN_INFO PFX "Option switches (0x%02x): " 250 - "Temperature Reset Enable=%s, Power On Delay=%s\n", 250 + pr_info("Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", 251 251 option_switches, 252 252 ((option_switches & 0x10) ? "ON" : "OFF"), 253 253 ((option_switches & 0x08) ? "ON" : "OFF")); 254 254 255 255 if (pcipcwd_private.boot_status & WDIOF_CARDRESET) 256 - printk(KERN_INFO PFX 257 - "Previous reset was caused by the Watchdog card\n"); 256 + pr_info("Previous reset was caused by the Watchdog card\n"); 258 257 259 258 if (pcipcwd_private.boot_status & WDIOF_OVERHEAT) 260 - printk(KERN_INFO PFX "Card sensed a CPU Overheat\n"); 259 + pr_info("Card sensed a CPU Overheat\n"); 261 260 262 261 if (pcipcwd_private.boot_status == 0) 263 - printk(KERN_INFO PFX 264 - "No previous trip detected - Cold boot or reset\n"); 262 + pr_info("No previous trip detected - Cold boot or reset\n"); 265 263 } 266 264 267 265 static int pcipcwd_start(void) ··· 272 278 spin_unlock(&pcipcwd_private.io_lock); 273 279 274 280 if (stat_reg & WD_PCI_WDIS) { 275 - printk(KERN_ERR PFX "Card timer not enabled\n"); 281 + pr_err("Card timer not enabled\n"); 276 282 return -1; 277 283 } 278 284 279 285 if (debug >= VERBOSE) 280 - printk(KERN_DEBUG PFX "Watchdog started\n"); 286 + pr_debug("Watchdog started\n"); 281 287 282 288 return 0; 283 289 } ··· 297 303 spin_unlock(&pcipcwd_private.io_lock); 298 304 299 305 if (!(stat_reg & WD_PCI_WDIS)) { 300 - printk(KERN_ERR PFX 301 - "Card did not acknowledge disable attempt\n"); 306 + pr_err("Card did not acknowledge disable attempt\n"); 302 307 return -1; 303 308 } 304 309 305 310 if (debug >= VERBOSE) 306 - printk(KERN_DEBUG PFX "Watchdog stopped\n"); 311 + pr_debug("Watchdog stopped\n"); 307 312 308 313 return 0; 309 314 } ··· 315 322 spin_unlock(&pcipcwd_private.io_lock); 316 323 317 324 if (debug >= DEBUG) 318 - printk(KERN_DEBUG PFX "Watchdog keepalive signal send\n"); 325 + pr_debug("Watchdog keepalive signal send\n"); 319 326 320 327 return 0; 321 328 } ··· 333 340 334 341 heartbeat = t; 335 342 if (debug >= VERBOSE) 336 - printk(KERN_DEBUG PFX "New heartbeat: %d\n", 337 - heartbeat); 343 + pr_debug("New heartbeat: %d\n", heartbeat); 338 344 339 345 return 0; 340 346 } ··· 349 357 if (control_status & WD_PCI_TTRP) { 350 358 *status |= WDIOF_OVERHEAT; 351 359 if (temp_panic) 352 - panic(PFX "Temperature overheat trip!\n"); 360 + panic(KBUILD_MODNAME ": Temperature overheat trip!\n"); 353 361 } 354 362 355 363 if (debug >= DEBUG) 356 - printk(KERN_DEBUG PFX "Control Status #1: 0x%02x\n", 357 - control_status); 364 + pr_debug("Control Status #1: 0x%02x\n", control_status); 358 365 359 366 return 0; 360 367 } ··· 365 374 int reset_counter; 366 375 367 376 if (debug >= VERBOSE) 368 - printk(KERN_INFO PFX "clearing watchdog trip status & LED\n"); 377 + pr_info("clearing watchdog trip status & LED\n"); 369 378 370 379 control_status = inb_p(pcipcwd_private.io_addr + 1); 371 380 372 381 if (debug >= DEBUG) { 373 - printk(KERN_DEBUG PFX "status was: 0x%02x\n", control_status); 374 - printk(KERN_DEBUG PFX "sending: 0x%02x\n", 375 - (control_status & WD_PCI_R2DS) | WD_PCI_WTRP); 382 + pr_debug("status was: 0x%02x\n", control_status); 383 + pr_debug("sending: 0x%02x\n", 384 + (control_status & WD_PCI_R2DS) | WD_PCI_WTRP); 376 385 } 377 386 378 387 /* clear trip status & LED and keep mode of relay 2 */ ··· 385 394 send_command(CMD_GET_CLEAR_RESET_COUNT, &msb, &reset_counter); 386 395 387 396 if (debug >= DEBUG) { 388 - printk(KERN_DEBUG PFX "reset count was: 0x%02x\n", 389 - reset_counter); 397 + pr_debug("reset count was: 0x%02x\n", reset_counter); 390 398 } 391 399 392 400 return 0; ··· 408 418 *temperature = (*temperature * 9 / 5) + 32; 409 419 410 420 if (debug >= DEBUG) { 411 - printk(KERN_DEBUG PFX "temperature is: %d F\n", 412 - *temperature); 421 + pr_debug("temperature is: %d F\n", *temperature); 413 422 } 414 423 415 424 return 0; ··· 426 437 *time_left = (msb << 8) + lsb; 427 438 428 439 if (debug >= VERBOSE) 429 - printk(KERN_DEBUG PFX "Time left before next reboot: %d\n", 430 - *time_left); 440 + pr_debug("Time left before next reboot: %d\n", *time_left); 431 441 432 442 return 0; 433 443 } ··· 571 583 /* /dev/watchdog can only be opened once */ 572 584 if (test_and_set_bit(0, &is_active)) { 573 585 if (debug >= VERBOSE) 574 - printk(KERN_ERR PFX 575 - "Attempt to open already opened device.\n"); 586 + pr_err("Attempt to open already opened device\n"); 576 587 return -EBUSY; 577 588 } 578 589 ··· 589 602 if (expect_release == 42) { 590 603 pcipcwd_stop(); 591 604 } else { 592 - printk(KERN_CRIT PFX 593 - "Unexpected close, not stopping watchdog!\n"); 605 + pr_crit("Unexpected close, not stopping watchdog!\n"); 594 606 pcipcwd_keepalive(); 595 607 } 596 608 expect_release = 0; ··· 689 703 690 704 cards_found++; 691 705 if (cards_found == 1) 692 - printk(KERN_INFO PFX DRIVER_VERSION); 706 + pr_info("%s\n", DRIVER_VERSION); 693 707 694 708 if (cards_found > 1) { 695 - printk(KERN_ERR PFX "This driver only supports 1 device\n"); 709 + pr_err("This driver only supports 1 device\n"); 696 710 return -ENODEV; 697 711 } 698 712 699 713 if (pci_enable_device(pdev)) { 700 - printk(KERN_ERR PFX "Not possible to enable PCI Device\n"); 714 + pr_err("Not possible to enable PCI Device\n"); 701 715 return -ENODEV; 702 716 } 703 717 704 718 if (pci_resource_start(pdev, 0) == 0x0000) { 705 - printk(KERN_ERR PFX "No I/O-Address for card detected\n"); 719 + pr_err("No I/O-Address for card detected\n"); 706 720 ret = -ENODEV; 707 721 goto err_out_disable_device; 708 722 } ··· 711 725 pcipcwd_private.io_addr = pci_resource_start(pdev, 0); 712 726 713 727 if (pci_request_regions(pdev, WATCHDOG_NAME)) { 714 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 715 - (int) pcipcwd_private.io_addr); 728 + pr_err("I/O address 0x%04x already in use\n", 729 + (int) pcipcwd_private.io_addr); 716 730 ret = -EIO; 717 731 goto err_out_disable_device; 718 732 } ··· 741 755 * if not reset to the default */ 742 756 if (pcipcwd_set_heartbeat(heartbeat)) { 743 757 pcipcwd_set_heartbeat(WATCHDOG_HEARTBEAT); 744 - printk(KERN_INFO PFX 745 - "heartbeat value must be 0<heartbeat<65536, using %d\n", 758 + pr_info("heartbeat value must be 0<heartbeat<65536, using %d\n", 746 759 WATCHDOG_HEARTBEAT); 747 760 } 748 761 749 762 ret = register_reboot_notifier(&pcipcwd_notifier); 750 763 if (ret != 0) { 751 - printk(KERN_ERR PFX 752 - "cannot register reboot notifier (err=%d)\n", ret); 764 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 753 765 goto err_out_release_region; 754 766 } 755 767 756 768 if (pcipcwd_private.supports_temp) { 757 769 ret = misc_register(&pcipcwd_temp_miscdev); 758 770 if (ret != 0) { 759 - printk(KERN_ERR PFX "cannot register miscdev on " 760 - "minor=%d (err=%d)\n", TEMP_MINOR, ret); 771 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 772 + TEMP_MINOR, ret); 761 773 goto err_out_unregister_reboot; 762 774 } 763 775 } 764 776 765 777 ret = misc_register(&pcipcwd_miscdev); 766 778 if (ret != 0) { 767 - printk(KERN_ERR PFX 768 - "cannot register miscdev on minor=%d (err=%d)\n", 769 - WATCHDOG_MINOR, ret); 779 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 780 + WATCHDOG_MINOR, ret); 770 781 goto err_out_misc_deregister; 771 782 } 772 783 773 - printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", 784 + pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", 774 785 heartbeat, nowayout); 775 786 776 787 return 0; ··· 825 842 { 826 843 pci_unregister_driver(&pcipcwd_driver); 827 844 828 - printk(KERN_INFO PFX "Watchdog Module Unloaded.\n"); 845 + pr_info("Watchdog Module Unloaded\n"); 829 846 } 830 847 831 848 module_init(pcipcwd_init_module);
+35 -39
drivers/watchdog/pcwd_usb.c
··· 24 24 * http://www.berkprod.com/ or http://www.pcwatchdog.com/ 25 25 */ 26 26 27 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 28 + 27 29 #include <linux/module.h> /* For module specific items */ 28 30 #include <linux/moduleparam.h> /* For new moduleparam's */ 29 31 #include <linux/types.h> /* For standard types (like size_t) */ ··· 44 42 #include <linux/hid.h> /* For HID_REQ_SET_REPORT & HID_DT_REPORT */ 45 43 #include <linux/uaccess.h> /* For copy_to_user/put_user/... */ 46 44 47 - 48 45 #ifdef CONFIG_USB_DEBUG 49 - static int debug = 1; 46 + static int debug = 1; 50 47 #else 51 - static int debug; 48 + static int debug; 52 49 #endif 53 50 54 51 /* Use our own dbg macro */ 52 + 55 53 #undef dbg 56 - #define dbg(format, arg...) \ 57 - do { if (debug) printk(KERN_DEBUG PFX format "\n" , ## arg); } while (0) 54 + #ifndef DEBUG 55 + #define DEBUG 56 + #endif 57 + #define dbg(format, ...) \ 58 + do { \ 59 + if (debug) \ 60 + pr_debug(format "\n", ##__VA_ARGS__); \ 61 + } while (0) 58 62 59 63 /* Module and Version Information */ 60 64 #define DRIVER_VERSION "1.02" ··· 68 60 #define DRIVER_DESC "Berkshire USB-PC Watchdog driver" 69 61 #define DRIVER_LICENSE "GPL" 70 62 #define DRIVER_NAME "pcwd_usb" 71 - #define PFX DRIVER_NAME ": " 72 63 73 64 MODULE_AUTHOR(DRIVER_AUTHOR); 74 65 MODULE_DESCRIPTION(DRIVER_DESC); ··· 227 220 resubmit: 228 221 retval = usb_submit_urb(urb, GFP_ATOMIC); 229 222 if (retval) 230 - printk(KERN_ERR PFX "can't resubmit intr, " 231 - "usb_submit_urb failed with result %d\n", retval); 223 + pr_err("can't resubmit intr, usb_submit_urb failed with result %d\n", 224 + retval); 232 225 } 233 226 234 227 static int usb_pcwd_send_command(struct usb_pcwd_private *usb_pcwd, ··· 291 284 &msb, &lsb); 292 285 293 286 if ((retval == 0) || (lsb == 0)) { 294 - printk(KERN_ERR PFX 295 - "Card did not acknowledge enable attempt\n"); 287 + pr_err("Card did not acknowledge enable attempt\n"); 296 288 return -1; 297 289 } 298 290 ··· 309 303 &msb, &lsb); 310 304 311 305 if ((retval == 0) || (lsb != 0)) { 312 - printk(KERN_ERR PFX 313 - "Card did not acknowledge disable attempt\n"); 306 + pr_err("Card did not acknowledge disable attempt\n"); 314 307 return -1; 315 308 } 316 309 ··· 511 506 if (expect_release == 42) { 512 507 usb_pcwd_stop(usb_pcwd_device); 513 508 } else { 514 - printk(KERN_CRIT PFX 515 - "Unexpected close, not stopping watchdog!\n"); 509 + pr_crit("Unexpected close, not stopping watchdog!\n"); 516 510 usb_pcwd_keepalive(usb_pcwd_device); 517 511 } 518 512 expect_release = 0; ··· 631 627 632 628 cards_found++; 633 629 if (cards_found > 1) { 634 - printk(KERN_ERR PFX "This driver only supports 1 device\n"); 630 + pr_err("This driver only supports 1 device\n"); 635 631 return -ENODEV; 636 632 } 637 633 ··· 640 636 641 637 /* check out that we have a HID device */ 642 638 if (!(iface_desc->desc.bInterfaceClass == USB_CLASS_HID)) { 643 - printk(KERN_ERR PFX 644 - "The device isn't a Human Interface Device\n"); 639 + pr_err("The device isn't a Human Interface Device\n"); 645 640 return -ENODEV; 646 641 } 647 642 ··· 649 646 650 647 if (!usb_endpoint_is_int_in(endpoint)) { 651 648 /* we didn't find a Interrupt endpoint with direction IN */ 652 - printk(KERN_ERR PFX "Couldn't find an INTR & IN endpoint\n"); 649 + pr_err("Couldn't find an INTR & IN endpoint\n"); 653 650 return -ENODEV; 654 651 } 655 652 ··· 660 657 /* allocate memory for our device and initialize it */ 661 658 usb_pcwd = kzalloc(sizeof(struct usb_pcwd_private), GFP_KERNEL); 662 659 if (usb_pcwd == NULL) { 663 - printk(KERN_ERR PFX "Out of memory\n"); 660 + pr_err("Out of memory\n"); 664 661 goto error; 665 662 } 666 663 ··· 677 674 usb_pcwd->intr_buffer = usb_alloc_coherent(udev, usb_pcwd->intr_size, 678 675 GFP_ATOMIC, &usb_pcwd->intr_dma); 679 676 if (!usb_pcwd->intr_buffer) { 680 - printk(KERN_ERR PFX "Out of memory\n"); 677 + pr_err("Out of memory\n"); 681 678 goto error; 682 679 } 683 680 684 681 /* allocate the urb's */ 685 682 usb_pcwd->intr_urb = usb_alloc_urb(0, GFP_KERNEL); 686 683 if (!usb_pcwd->intr_urb) { 687 - printk(KERN_ERR PFX "Out of memory\n"); 684 + pr_err("Out of memory\n"); 688 685 goto error; 689 686 } 690 687 ··· 697 694 698 695 /* register our interrupt URB with the USB system */ 699 696 if (usb_submit_urb(usb_pcwd->intr_urb, GFP_KERNEL)) { 700 - printk(KERN_ERR PFX "Problem registering interrupt URB\n"); 697 + pr_err("Problem registering interrupt URB\n"); 701 698 retval = -EIO; /* failure */ 702 699 goto error; 703 700 } ··· 716 713 else 717 714 sprintf(fw_ver_str, "<card no answer>"); 718 715 719 - printk(KERN_INFO PFX "Found card (Firmware: %s) with temp option\n", 720 - fw_ver_str); 716 + pr_info("Found card (Firmware: %s) with temp option\n", fw_ver_str); 721 717 722 718 /* Get switch settings */ 723 719 usb_pcwd_send_command(usb_pcwd, CMD_GET_DIP_SWITCH_SETTINGS, &dummy, 724 720 &option_switches); 725 721 726 - printk(KERN_INFO PFX "Option switches (0x%02x): " 727 - "Temperature Reset Enable=%s, Power On Delay=%s\n", 722 + pr_info("Option switches (0x%02x): Temperature Reset Enable=%s, Power On Delay=%s\n", 728 723 option_switches, 729 724 ((option_switches & 0x10) ? "ON" : "OFF"), 730 725 ((option_switches & 0x08) ? "ON" : "OFF")); ··· 735 734 * if not reset to the default */ 736 735 if (usb_pcwd_set_heartbeat(usb_pcwd, heartbeat)) { 737 736 usb_pcwd_set_heartbeat(usb_pcwd, WATCHDOG_HEARTBEAT); 738 - printk(KERN_INFO PFX 739 - "heartbeat value must be 0<heartbeat<65536, using %d\n", 737 + pr_info("heartbeat value must be 0<heartbeat<65536, using %d\n", 740 738 WATCHDOG_HEARTBEAT); 741 739 } 742 740 743 741 retval = register_reboot_notifier(&usb_pcwd_notifier); 744 742 if (retval != 0) { 745 - printk(KERN_ERR PFX 746 - "cannot register reboot notifier (err=%d)\n", 747 - retval); 743 + pr_err("cannot register reboot notifier (err=%d)\n", retval); 748 744 goto error; 749 745 } 750 746 751 747 retval = misc_register(&usb_pcwd_temperature_miscdev); 752 748 if (retval != 0) { 753 - printk(KERN_ERR PFX 754 - "cannot register miscdev on minor=%d (err=%d)\n", 755 - TEMP_MINOR, retval); 749 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 750 + TEMP_MINOR, retval); 756 751 goto err_out_unregister_reboot; 757 752 } 758 753 759 754 retval = misc_register(&usb_pcwd_miscdev); 760 755 if (retval != 0) { 761 - printk(KERN_ERR PFX 762 - "cannot register miscdev on minor=%d (err=%d)\n", 763 - WATCHDOG_MINOR, retval); 756 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 757 + WATCHDOG_MINOR, retval); 764 758 goto err_out_misc_deregister; 765 759 } 766 760 767 761 /* we can register the device now, as it is ready */ 768 762 usb_set_intfdata(interface, usb_pcwd); 769 763 770 - printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", 764 + pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", 771 765 heartbeat, nowayout); 772 766 773 767 return 0; ··· 820 824 821 825 mutex_unlock(&disconnect_mutex); 822 826 823 - printk(KERN_INFO PFX "USB PC Watchdog disconnected\n"); 827 + pr_info("USB PC Watchdog disconnected\n"); 824 828 } 825 829 826 830 module_usb_driver(usb_pcwd_driver);
+10 -9
drivers/watchdog/pika_wdt.c
··· 5 5 * Sean MacLennan <smaclennan@pikatech.com> 6 6 */ 7 7 8 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 9 + 8 10 #include <linux/init.h> 9 11 #include <linux/errno.h> 10 12 #include <linux/module.h> ··· 25 23 #include <linux/of_platform.h> 26 24 27 25 #define DRV_NAME "PIKA-WDT" 28 - #define PFX DRV_NAME ": " 29 26 30 27 /* Hardware timeout in seconds */ 31 28 #define WDT_HW_TIMEOUT 2 ··· 91 90 pikawdt_reset(); 92 91 mod_timer(&pikawdt_private.timer, jiffies + WDT_TIMEOUT); 93 92 } else 94 - printk(KERN_CRIT PFX "I will reset your machine !\n"); 93 + pr_crit("I will reset your machine !\n"); 95 94 } 96 95 97 96 ··· 229 228 230 229 np = of_find_compatible_node(NULL, NULL, "pika,fpga"); 231 230 if (np == NULL) { 232 - printk(KERN_ERR PFX "Unable to find fpga.\n"); 231 + pr_err("Unable to find fpga\n"); 233 232 return -ENOENT; 234 233 } 235 234 236 235 pikawdt_private.fpga = of_iomap(np, 0); 237 236 of_node_put(np); 238 237 if (pikawdt_private.fpga == NULL) { 239 - printk(KERN_ERR PFX "Unable to map fpga.\n"); 238 + pr_err("Unable to map fpga\n"); 240 239 return -ENOMEM; 241 240 } 242 241 ··· 245 244 /* POST information is in the sd area. */ 246 245 np = of_find_compatible_node(NULL, NULL, "pika,fpga-sd"); 247 246 if (np == NULL) { 248 - printk(KERN_ERR PFX "Unable to find fpga-sd.\n"); 247 + pr_err("Unable to find fpga-sd\n"); 249 248 ret = -ENOENT; 250 249 goto out; 251 250 } ··· 253 252 fpga = of_iomap(np, 0); 254 253 of_node_put(np); 255 254 if (fpga == NULL) { 256 - printk(KERN_ERR PFX "Unable to map fpga-sd.\n"); 255 + pr_err("Unable to map fpga-sd\n"); 257 256 ret = -ENOMEM; 258 257 goto out; 259 258 } ··· 272 271 273 272 ret = misc_register(&pikawdt_miscdev); 274 273 if (ret) { 275 - printk(KERN_ERR PFX "Unable to register miscdev.\n"); 274 + pr_err("Unable to register miscdev\n"); 276 275 goto out; 277 276 } 278 277 279 - printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", 280 - heartbeat, nowayout); 278 + pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", 279 + heartbeat, nowayout); 281 280 return 0; 282 281 283 282 out:
+3 -1
drivers/watchdog/pnx4008_wdt.c
··· 14 14 * or implied. 15 15 */ 16 16 17 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 18 + 17 19 #include <linux/module.h> 18 20 #include <linux/moduleparam.h> 19 21 #include <linux/types.h> ··· 224 222 static int pnx4008_wdt_release(struct inode *inode, struct file *file) 225 223 { 226 224 if (!test_bit(WDT_OK_TO_CLOSE, &wdt_status)) 227 - printk(KERN_WARNING "WATCHDOG: Device closed unexpectedly\n"); 225 + pr_warn("Device closed unexpectedly\n"); 228 226 229 227 wdt_disable(); 230 228 clk_disable(wdt_clk);
+11 -15
drivers/watchdog/pnx833x_wdt.c
··· 17 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 22 #include <linux/module.h> 21 23 #include <linux/moduleparam.h> 22 24 #include <linux/types.h> ··· 32 30 #include <linux/init.h> 33 31 #include <asm/mach-pnx833x/pnx833x.h> 34 32 35 - #define PFX "pnx833x: " 36 33 #define WATCHDOG_TIMEOUT 30 /* 30 sec Maximum timeout */ 37 34 #define WATCHDOG_COUNT_FREQUENCY 68000000U /* Watchdog counts at 68MHZ. */ 38 35 #define PNX_WATCHDOG_TIMEOUT (WATCHDOG_TIMEOUT * WATCHDOG_COUNT_FREQUENCY) ··· 77 76 PNX833X_REG(PNX833X_CONFIG + 78 77 PNX833X_CONFIG_CPU_COUNTERS_CONTROL) |= 0x1; 79 78 80 - printk(KERN_INFO PFX "Started watchdog timer.\n"); 79 + pr_info("Started watchdog timer\n"); 81 80 } 82 81 83 82 static void pnx833x_wdt_stop(void) ··· 88 87 PNX833X_REG(PNX833X_CONFIG + 89 88 PNX833X_CONFIG_CPU_COUNTERS_CONTROL) &= 0xFFFFFFFE; 90 89 91 - printk(KERN_INFO PFX "Stopped watchdog timer.\n"); 90 + pr_info("Stopped watchdog timer\n"); 92 91 } 93 92 94 93 static void pnx833x_wdt_ping(void) ··· 114 113 115 114 pnx833x_wdt_ping(); 116 115 117 - printk(KERN_INFO "Started watchdog timer.\n"); 116 + pr_info("Started watchdog timer\n"); 118 117 119 118 return nonseekable_open(inode, file); 120 119 } ··· 233 232 .notifier_call = pnx833x_wdt_notify_sys, 234 233 }; 235 234 236 - static char banner[] __initdata = 237 - KERN_INFO PFX "Hardware Watchdog Timer for PNX833x: Version 0.1\n"; 238 - 239 235 static int __init watchdog_init(void) 240 236 { 241 237 int ret, cause; ··· 241 243 cause = PNX833X_REG(PNX833X_RESET); 242 244 /*If bit 31 is set then watchdog was cause of reset.*/ 243 245 if (cause & 0x80000000) { 244 - printk(KERN_INFO PFX "The system was previously reset due to " 245 - "the watchdog firing - please investigate...\n"); 246 + pr_info("The system was previously reset due to the watchdog firing - please investigate...\n"); 246 247 } 247 248 248 249 ret = register_reboot_notifier(&pnx833x_wdt_notifier); 249 250 if (ret) { 250 - printk(KERN_ERR PFX 251 - "cannot register reboot notifier (err=%d)\n", ret); 251 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 252 252 return ret; 253 253 } 254 254 255 255 ret = misc_register(&pnx833x_wdt_miscdev); 256 256 if (ret) { 257 - printk(KERN_ERR PFX 258 - "cannot register miscdev on minor=%d (err=%d)\n", 259 - WATCHDOG_MINOR, ret); 257 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 258 + WATCHDOG_MINOR, ret); 260 259 unregister_reboot_notifier(&pnx833x_wdt_notifier); 261 260 return ret; 262 261 } 263 262 264 - printk(banner); 263 + pr_info("Hardware Watchdog Timer for PNX833x: Version 0.1\n"); 264 + 265 265 if (start_enabled) 266 266 pnx833x_wdt_start(); 267 267
+12 -17
drivers/watchdog/rc32434_wdt.c
··· 17 17 * 18 18 */ 19 19 20 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 + 20 22 #include <linux/module.h> /* For module specific items */ 21 23 #include <linux/moduleparam.h> /* For new moduleparam's */ 22 24 #include <linux/types.h> /* For standard types (like size_t) */ ··· 34 32 #include <linux/uaccess.h> /* For copy_to_user/put_user/... */ 35 33 36 34 #include <asm/mach-rc32434/integ.h> /* For the Watchdog registers */ 37 - 38 - #define PFX KBUILD_MODNAME ": " 39 35 40 36 #define VERSION "1.0" 41 37 ··· 78 78 int max_to = WTCOMP2SEC((u32)-1); 79 79 80 80 if (new_timeout < 0 || new_timeout > max_to) { 81 - printk(KERN_ERR PFX "timeout value must be between 0 and %d", 82 - max_to); 81 + pr_err("timeout value must be between 0 and %d\n", max_to); 83 82 return -EINVAL; 84 83 } 85 84 timeout = new_timeout; ··· 118 119 SET_BITS(wdt_reg->wtc, or, nand); 119 120 120 121 spin_unlock(&rc32434_wdt_device.io_lock); 121 - printk(KERN_INFO PFX "Started watchdog timer.\n"); 122 + pr_info("Started watchdog timer\n"); 122 123 } 123 124 124 125 static void rc32434_wdt_stop(void) ··· 129 130 SET_BITS(wdt_reg->wtc, 0, 1 << RC32434_WTC_EN); 130 131 131 132 spin_unlock(&rc32434_wdt_device.io_lock); 132 - printk(KERN_INFO PFX "Stopped watchdog timer.\n"); 133 + pr_info("Stopped watchdog timer\n"); 133 134 } 134 135 135 136 static void rc32434_wdt_ping(void) ··· 159 160 rc32434_wdt_stop(); 160 161 module_put(THIS_MODULE); 161 162 } else { 162 - printk(KERN_CRIT PFX 163 - "device closed unexpectedly. WDT will not stop!\n"); 163 + pr_crit("device closed unexpectedly. WDT will not stop!\n"); 164 164 rc32434_wdt_ping(); 165 165 } 166 166 clear_bit(0, &rc32434_wdt_device.inuse); ··· 260 262 .fops = &rc32434_wdt_fops, 261 263 }; 262 264 263 - static char banner[] __devinitdata = KERN_INFO PFX 264 - "Watchdog Timer version " VERSION ", timer margin: %d sec\n"; 265 - 266 265 static int __devinit rc32434_wdt_probe(struct platform_device *pdev) 267 266 { 268 267 int ret; ··· 267 272 268 273 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rb532_wdt_res"); 269 274 if (!r) { 270 - printk(KERN_ERR PFX "failed to retrieve resources\n"); 275 + pr_err("failed to retrieve resources\n"); 271 276 return -ENODEV; 272 277 } 273 278 274 279 wdt_reg = ioremap_nocache(r->start, resource_size(r)); 275 280 if (!wdt_reg) { 276 - printk(KERN_ERR PFX "failed to remap I/O resources\n"); 281 + pr_err("failed to remap I/O resources\n"); 277 282 return -ENXIO; 278 283 } 279 284 ··· 286 291 * if not reset to the default */ 287 292 if (rc32434_wdt_set(timeout)) { 288 293 rc32434_wdt_set(WATCHDOG_TIMEOUT); 289 - printk(KERN_INFO PFX 290 - "timeout value must be between 0 and %d\n", 294 + pr_info("timeout value must be between 0 and %d\n", 291 295 WTCOMP2SEC((u32)-1)); 292 296 } 293 297 294 298 ret = misc_register(&rc32434_wdt_miscdev); 295 299 if (ret < 0) { 296 - printk(KERN_ERR PFX "failed to register watchdog device\n"); 300 + pr_err("failed to register watchdog device\n"); 297 301 goto unmap; 298 302 } 299 303 300 - printk(banner, timeout); 304 + pr_info("Watchdog Timer version " VERSION ", timer margin: %d sec\n", 305 + timeout); 301 306 302 307 return 0; 303 308
+6 -4
drivers/watchdog/riowd.c
··· 3 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 8 #include <linux/kernel.h> 7 9 #include <linux/module.h> 8 10 #include <linux/types.h> ··· 191 189 192 190 p->regs = of_ioremap(&op->resource[0], 0, 2, DRIVER_NAME); 193 191 if (!p->regs) { 194 - printk(KERN_ERR PFX "Cannot map registers.\n"); 192 + pr_err("Cannot map registers\n"); 195 193 goto out_free; 196 194 } 197 195 /* Make miscdev useable right away */ ··· 199 197 200 198 err = misc_register(&riowd_miscdev); 201 199 if (err) { 202 - printk(KERN_ERR PFX "Cannot register watchdog misc device.\n"); 200 + pr_err("Cannot register watchdog misc device\n"); 203 201 goto out_iounmap; 204 202 } 205 203 206 - printk(KERN_INFO PFX "Hardware watchdog [%i minutes], " 207 - "regs at %p\n", riowd_timeout, p->regs); 204 + pr_info("Hardware watchdog [%i minutes], regs at %p\n", 205 + riowd_timeout, p->regs); 208 206 209 207 dev_set_drvdata(&op->dev, p); 210 208 return 0;
+12 -13
drivers/watchdog/s3c2410_wdt.c
··· 23 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 28 #include <linux/module.h> 27 29 #include <linux/moduleparam.h> 28 30 #include <linux/types.h> ··· 47 45 #define S3C_VA_WATCHDOG (0) 48 46 49 47 #include <plat/regs-watchdog.h> 50 - 51 - #define PFX "s3c2410-wdt: " 52 48 53 49 #define CONFIG_S3C2410_WATCHDOG_ATBOOT (0) 54 50 #define CONFIG_S3C2410_WATCHDOG_DEFAULT_TIME (15) ··· 84 84 85 85 /* watchdog control routines */ 86 86 87 - #define DBG(msg...) do { \ 88 - if (debug) \ 89 - printk(KERN_INFO msg); \ 90 - } while (0) 87 + #define DBG(fmt, ...) \ 88 + do { \ 89 + if (debug) \ 90 + pr_info(fmt, ##__VA_ARGS__); \ 91 + } while (0) 91 92 92 93 /* functions */ 93 94 ··· 355 354 356 355 ret = s3c2410wdt_cpufreq_register(); 357 356 if (ret < 0) { 358 - printk(KERN_ERR PFX "failed to register cpufreq\n"); 357 + pr_err("failed to register cpufreq\n"); 359 358 goto err_clk; 360 359 } 361 360 ··· 484 483 writel(wtdat_save, wdt_base + S3C2410_WTCNT); /* Reset count */ 485 484 writel(wtcon_save, wdt_base + S3C2410_WTCON); 486 485 487 - printk(KERN_INFO PFX "watchdog %sabled\n", 488 - (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); 486 + pr_info("watchdog %sabled\n", 487 + (wtcon_save & S3C2410_WTCON_ENABLE) ? "en" : "dis"); 489 488 490 489 return 0; 491 490 } ··· 519 518 }; 520 519 521 520 522 - static char banner[] __initdata = 523 - KERN_INFO "S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; 524 - 525 521 static int __init watchdog_init(void) 526 522 { 527 - printk(banner); 523 + pr_info("S3C2410 Watchdog Timer, (c) 2004 Simtec Electronics\n"; 524 + 528 525 return platform_driver_register(&s3c2410wdt_driver); 529 526 } 530 527
+6 -4
drivers/watchdog/sa1100_wdt.c
··· 17 17 * 18 18 * 27/11/2000 Initial release 19 19 */ 20 + 21 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22 + 20 23 #include <linux/module.h> 21 24 #include <linux/moduleparam.h> 22 25 #include <linux/types.h> ··· 69 66 */ 70 67 static int sa1100dog_release(struct inode *inode, struct file *file) 71 68 { 72 - printk(KERN_CRIT "WATCHDOG: Device closed - timer will not stop\n"); 69 + pr_crit("Device closed - timer will not stop\n"); 73 70 clear_bit(1, &sa1100wdt_users); 74 71 return 0; 75 72 } ··· 172 169 173 170 ret = misc_register(&sa1100dog_miscdev); 174 171 if (ret == 0) 175 - printk(KERN_INFO 176 - "SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", 177 - margin); 172 + pr_info("SA1100/PXA2xx Watchdog Timer: timer margin %d sec\n", 173 + margin); 178 174 return ret; 179 175 } 180 176
+14 -14
drivers/watchdog/sb_wdog.c
··· 43 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 49 #include <linux/module.h> 47 50 #include <linux/io.h> 48 51 #include <linux/uaccess.h> ··· 128 125 __raw_writeb(0, user_dog); 129 126 module_put(THIS_MODULE); 130 127 } else { 131 - printk(KERN_CRIT 132 - "%s: Unexpected close, not stopping watchdog!\n", 133 - ident.identity); 128 + pr_crit("%s: Unexpected close, not stopping watchdog!\n", 129 + ident.identity); 134 130 sbwdog_pet(user_dog); 135 131 } 136 132 clear_bit(0, &sbwdog_gate); ··· 271 269 * if it's the second watchdog timer, it's for those users 272 270 */ 273 271 if (wd_cfg_reg == user_dog) 274 - printk(KERN_CRIT "%s in danger of initiating system reset " 272 + pr_crit("%s in danger of initiating system reset " 275 273 "in %ld.%01ld seconds\n", 276 274 ident.identity, 277 275 wd_init / 1000000, (wd_init / 100000) % 10); ··· 292 290 */ 293 291 ret = register_reboot_notifier(&sbwdog_notifier); 294 292 if (ret) { 295 - printk(KERN_ERR 296 - "%s: cannot register reboot notifier (err=%d)\n", 297 - ident.identity, ret); 293 + pr_err("%s: cannot register reboot notifier (err=%d)\n", 294 + ident.identity, ret); 298 295 return ret; 299 296 } 300 297 ··· 304 303 ret = request_irq(1, sbwdog_interrupt, IRQF_SHARED, 305 304 ident.identity, (void *)user_dog); 306 305 if (ret) { 307 - printk(KERN_ERR "%s: failed to request irq 1 - %d\n", 308 - ident.identity, ret); 306 + pr_err("%s: failed to request irq 1 - %d\n", 307 + ident.identity, ret); 309 308 goto out; 310 309 } 311 310 312 311 ret = misc_register(&sbwdog_miscdev); 313 312 if (ret == 0) { 314 - printk(KERN_INFO "%s: timeout is %ld.%ld secs\n", 315 - ident.identity, 316 - timeout / 1000000, (timeout / 100000) % 10); 313 + pr_info("%s: timeout is %ld.%ld secs\n", 314 + ident.identity, 315 + timeout / 1000000, (timeout / 100000) % 10); 317 316 return 0; 318 317 } 319 318 free_irq(1, (void *)user_dog); ··· 354 353 ret = request_irq(1, sbwdog_interrupt, IRQF_SHARED, 355 354 "Kernel Watchdog", IOADDR(A_SCD_WDOG_CFG_0)); 356 355 if (ret) { 357 - printk(KERN_CRIT 358 - "Watchdog IRQ zero(0) failed to be requested - %d\n", ret); 356 + pr_crit("Watchdog IRQ zero(0) failed to be requested - %d\n", ret); 359 357 } 360 358 } 361 359
+15 -22
drivers/watchdog/sbc60xxwdt.c
··· 48 48 * 49 49 */ 50 50 51 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 52 + 51 53 #include <linux/module.h> 52 54 #include <linux/moduleparam.h> 53 55 #include <linux/types.h> ··· 134 132 /* Re-set the timer interval */ 135 133 mod_timer(&timer, jiffies + WDT_INTERVAL); 136 134 } else 137 - printk(KERN_WARNING PFX 138 - "Heartbeat lost! Will not ping the watchdog\n"); 135 + pr_warn("Heartbeat lost! Will not ping the watchdog\n"); 139 136 } 140 137 141 138 /* ··· 147 146 148 147 /* Start the timer */ 149 148 mod_timer(&timer, jiffies + WDT_INTERVAL); 150 - printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); 149 + pr_info("Watchdog timer is now enabled\n"); 151 150 } 152 151 153 152 static void wdt_turnoff(void) ··· 155 154 /* Stop the timer */ 156 155 del_timer(&timer); 157 156 inb_p(wdt_stop); 158 - printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); 157 + pr_info("Watchdog timer is now disabled...\n"); 159 158 } 160 159 161 160 static void wdt_keepalive(void) ··· 218 217 wdt_turnoff(); 219 218 else { 220 219 del_timer(&timer); 221 - printk(KERN_CRIT PFX 222 - "device file closed unexpectedly. Will not stop the WDT!\n"); 220 + pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); 223 221 } 224 222 clear_bit(0, &wdt_is_open); 225 223 wdt_expect_close = 0; ··· 335 335 336 336 if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ 337 337 timeout = WATCHDOG_TIMEOUT; 338 - printk(KERN_INFO PFX 339 - "timeout value must be 1 <= x <= 3600, using %d\n", 340 - timeout); 338 + pr_info("timeout value must be 1 <= x <= 3600, using %d\n", 339 + timeout); 341 340 } 342 341 343 342 if (!request_region(wdt_start, 1, "SBC 60XX WDT")) { 344 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 345 - wdt_start); 343 + pr_err("I/O address 0x%04x already in use\n", wdt_start); 346 344 rc = -EIO; 347 345 goto err_out; 348 346 } ··· 348 350 /* We cannot reserve 0x45 - the kernel already has! */ 349 351 if (wdt_stop != 0x45 && wdt_stop != wdt_start) { 350 352 if (!request_region(wdt_stop, 1, "SBC 60XX WDT")) { 351 - printk(KERN_ERR PFX 352 - "I/O address 0x%04x already in use\n", 353 - wdt_stop); 353 + pr_err("I/O address 0x%04x already in use\n", wdt_stop); 354 354 rc = -EIO; 355 355 goto err_out_region1; 356 356 } ··· 356 360 357 361 rc = register_reboot_notifier(&wdt_notifier); 358 362 if (rc) { 359 - printk(KERN_ERR PFX 360 - "cannot register reboot notifier (err=%d)\n", rc); 363 + pr_err("cannot register reboot notifier (err=%d)\n", rc); 361 364 goto err_out_region2; 362 365 } 363 366 364 367 rc = misc_register(&wdt_miscdev); 365 368 if (rc) { 366 - printk(KERN_ERR PFX 367 - "cannot register miscdev on minor=%d (err=%d)\n", 368 - wdt_miscdev.minor, rc); 369 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 370 + wdt_miscdev.minor, rc); 369 371 goto err_out_reboot; 370 372 } 371 - printk(KERN_INFO PFX 372 - "WDT driver for 60XX single board computer initialised. " 373 - "timeout=%d sec (nowayout=%d)\n", timeout, nowayout); 373 + pr_info("WDT driver for 60XX single board computer initialised. timeout=%d sec (nowayout=%d)\n", 374 + timeout, nowayout); 374 375 375 376 return 0; 376 377
+15 -25
drivers/watchdog/sbc7240_wdt.c
··· 16 16 * 17 17 */ 18 18 19 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 20 + 19 21 #include <linux/fs.h> 20 22 #include <linux/init.h> 21 23 #include <linux/ioport.h> ··· 33 31 #include <linux/uaccess.h> 34 32 #include <linux/atomic.h> 35 33 #include <asm/system.h> 36 - 37 - #define SBC7240_PREFIX "sbc7240_wdt: " 38 34 39 35 #define SBC7240_ENABLE_PORT 0x443 40 36 #define SBC7240_DISABLE_PORT 0x043 ··· 65 65 /* disable the watchdog */ 66 66 if (test_and_clear_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { 67 67 inb_p(SBC7240_DISABLE_PORT); 68 - printk(KERN_INFO SBC7240_PREFIX 69 - "Watchdog timer is now disabled.\n"); 68 + pr_info("Watchdog timer is now disabled\n"); 70 69 } 71 70 } 72 71 ··· 74 75 /* enable the watchdog */ 75 76 if (!test_and_set_bit(SBC7240_ENABLED_STATUS_BIT, &wdt_status)) { 76 77 inb_p(SBC7240_ENABLE_PORT); 77 - printk(KERN_INFO SBC7240_PREFIX 78 - "Watchdog timer is now enabled.\n"); 78 + pr_info("Watchdog timer is now enabled\n"); 79 79 } 80 80 } 81 81 82 82 static int wdt_set_timeout(int t) 83 83 { 84 84 if (t < 1 || t > SBC7240_MAX_TIMEOUT) { 85 - printk(KERN_ERR SBC7240_PREFIX 86 - "timeout value must be 1<=x<=%d\n", 87 - SBC7240_MAX_TIMEOUT); 85 + pr_err("timeout value must be 1<=x<=%d\n", SBC7240_MAX_TIMEOUT); 88 86 return -1; 89 87 } 90 88 /* set the timeout */ 91 89 outb_p((unsigned)t, SBC7240_SET_TIMEOUT_PORT); 92 90 timeout = t; 93 - printk(KERN_INFO SBC7240_PREFIX "timeout set to %d seconds\n", t); 91 + pr_info("timeout set to %d seconds\n", t); 94 92 return 0; 95 93 } 96 94 ··· 146 150 || !nowayout) { 147 151 wdt_disable(); 148 152 } else { 149 - printk(KERN_CRIT SBC7240_PREFIX 150 - "Unexpected close, not stopping watchdog!\n"); 153 + pr_crit("Unexpected close, not stopping watchdog!\n"); 151 154 wdt_keepalive(); 152 155 } 153 156 ··· 247 252 248 253 static void __exit sbc7240_wdt_unload(void) 249 254 { 250 - printk(KERN_INFO SBC7240_PREFIX "Removing watchdog\n"); 255 + pr_info("Removing watchdog\n"); 251 256 misc_deregister(&wdt_miscdev); 252 257 253 258 unregister_reboot_notifier(&wdt_notifier); ··· 259 264 int rc = -EBUSY; 260 265 261 266 if (!request_region(SBC7240_ENABLE_PORT, 1, "SBC7240 WDT")) { 262 - printk(KERN_ERR SBC7240_PREFIX 263 - "I/O address 0x%04x already in use\n", 267 + pr_err("I/O address 0x%04x already in use\n", 264 268 SBC7240_ENABLE_PORT); 265 269 rc = -EIO; 266 270 goto err_out; ··· 271 277 272 278 if (timeout < 1 || timeout > SBC7240_MAX_TIMEOUT) { 273 279 timeout = SBC7240_TIMEOUT; 274 - printk(KERN_INFO SBC7240_PREFIX 275 - "timeout value must be 1<=x<=%d, using %d\n", 276 - SBC7240_MAX_TIMEOUT, timeout); 280 + pr_info("timeout value must be 1<=x<=%d, using %d\n", 281 + SBC7240_MAX_TIMEOUT, timeout); 277 282 } 278 283 wdt_set_timeout(timeout); 279 284 wdt_disable(); 280 285 281 286 rc = register_reboot_notifier(&wdt_notifier); 282 287 if (rc) { 283 - printk(KERN_ERR SBC7240_PREFIX 284 - "cannot register reboot notifier (err=%d)\n", rc); 288 + pr_err("cannot register reboot notifier (err=%d)\n", rc); 285 289 goto err_out_region; 286 290 } 287 291 288 292 rc = misc_register(&wdt_miscdev); 289 293 if (rc) { 290 - printk(KERN_ERR SBC7240_PREFIX 291 - "cannot register miscdev on minor=%d (err=%d)\n", 294 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 292 295 wdt_miscdev.minor, rc); 293 296 goto err_out_reboot_notifier; 294 297 } 295 298 296 - printk(KERN_INFO SBC7240_PREFIX 297 - "Watchdog driver for SBC7240 initialised (nowayout=%d)\n", 298 - nowayout); 299 + pr_info("Watchdog driver for SBC7240 initialised (nowayout=%d)\n", 300 + nowayout); 299 301 300 302 return 0; 301 303
+9 -11
drivers/watchdog/sbc8360.c
··· 36 36 * 37 37 */ 38 38 39 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 40 + 39 41 #include <linux/module.h> 40 42 #include <linux/types.h> 41 43 #include <linux/miscdevice.h> ··· 57 55 58 56 static unsigned long sbc8360_is_open; 59 57 static char expect_close; 60 - 61 - #define PFX "sbc8360: " 62 58 63 59 /* 64 60 * ··· 280 280 if (expect_close == 42) 281 281 sbc8360_stop(); 282 282 else 283 - printk(KERN_CRIT PFX "SBC8360 device closed unexpectedly. " 284 - "SBC8360 will not stop!\n"); 283 + pr_crit("SBC8360 device closed unexpectedly. SBC8360 will not stop!\n"); 285 284 286 285 clear_bit(0, &sbc8360_is_open); 287 286 expect_close = 0; ··· 333 334 unsigned long int mseconds = 60000; 334 335 335 336 if (timeout < 0 || timeout > 63) { 336 - printk(KERN_ERR PFX "Invalid timeout index (must be 0-63).\n"); 337 + pr_err("Invalid timeout index (must be 0-63)\n"); 337 338 res = -EINVAL; 338 339 goto out; 339 340 } 340 341 341 342 if (!request_region(SBC8360_ENABLE, 1, "SBC8360")) { 342 - printk(KERN_ERR PFX "ENABLE method I/O %X is not available.\n", 343 + pr_err("ENABLE method I/O %X is not available\n", 343 344 SBC8360_ENABLE); 344 345 res = -EIO; 345 346 goto out; 346 347 } 347 348 if (!request_region(SBC8360_BASETIME, 1, "SBC8360")) { 348 - printk(KERN_ERR PFX 349 - "BASETIME method I/O %X is not available.\n", 349 + pr_err("BASETIME method I/O %X is not available\n", 350 350 SBC8360_BASETIME); 351 351 res = -EIO; 352 352 goto out_nobasetimereg; ··· 353 355 354 356 res = register_reboot_notifier(&sbc8360_notifier); 355 357 if (res) { 356 - printk(KERN_ERR PFX "Failed to register reboot notifier.\n"); 358 + pr_err("Failed to register reboot notifier\n"); 357 359 goto out_noreboot; 358 360 } 359 361 360 362 res = misc_register(&sbc8360_miscdev); 361 363 if (res) { 362 - printk(KERN_ERR PFX "failed to register misc device\n"); 364 + pr_err("failed to register misc device\n"); 363 365 goto out_nomisc; 364 366 } 365 367 ··· 376 378 mseconds = (wd_margin + 1) * 100000; 377 379 378 380 /* My kingdom for the ability to print "0.5 seconds" in the kernel! */ 379 - printk(KERN_INFO PFX "Timeout set at %ld ms.\n", mseconds); 381 + pr_info("Timeout set at %ld ms\n", mseconds); 380 382 381 383 return 0; 382 384
+8 -11
drivers/watchdog/sbc_epx_c3.c
··· 13 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 18 #include <linux/module.h> 17 19 #include <linux/moduleparam.h> 18 20 #include <linux/types.h> ··· 30 28 #include <linux/uaccess.h> 31 29 #include <linux/io.h> 32 30 33 - #define PFX "epx_c3: " 34 31 static int epx_c3_alive; 35 32 36 33 #define WATCHDOG_TIMEOUT 1 /* 1 sec default timeout */ ··· 52 51 53 52 outb(0, EPXC3_WATCHDOG_CTL_REG); 54 53 55 - printk(KERN_INFO PFX "Stopped watchdog timer.\n"); 54 + pr_info("Stopped watchdog timer\n"); 56 55 } 57 56 58 57 static void epx_c3_pet(void) ··· 76 75 epx_c3_pet(); 77 76 78 77 epx_c3_alive = 1; 79 - printk(KERN_INFO "Started watchdog timer.\n"); 78 + pr_info("Started watchdog timer\n"); 80 79 81 80 return nonseekable_open(inode, file); 82 81 } ··· 174 173 .notifier_call = epx_c3_notify_sys, 175 174 }; 176 175 177 - static const char banner[] __initconst = KERN_INFO PFX 178 - "Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n"; 179 - 180 176 static int __init watchdog_init(void) 181 177 { 182 178 int ret; ··· 183 185 184 186 ret = register_reboot_notifier(&epx_c3_notifier); 185 187 if (ret) { 186 - printk(KERN_ERR PFX "cannot register reboot notifier " 187 - "(err=%d)\n", ret); 188 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 188 189 goto out; 189 190 } 190 191 191 192 ret = misc_register(&epx_c3_miscdev); 192 193 if (ret) { 193 - printk(KERN_ERR PFX "cannot register miscdev on minor=%d " 194 - "(err=%d)\n", WATCHDOG_MINOR, ret); 194 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 195 + WATCHDOG_MINOR, ret); 195 196 unregister_reboot_notifier(&epx_c3_notifier); 196 197 goto out; 197 198 } 198 199 199 - printk(banner); 200 + pr_info("Hardware Watchdog Timer for Winsystems EPX-C3 SBC: 0.1\n"); 200 201 201 202 return 0; 202 203
+4 -5
drivers/watchdog/sbc_fitpc2_wdt.c
··· 171 171 wdt_disable(); 172 172 pr_info("Device disabled\n"); 173 173 } else { 174 - pr_warning("Device closed unexpectedly -" 175 - " timer will not stop\n"); 174 + pr_warn("Device closed unexpectedly - timer will not stop\n"); 176 175 wdt_enable(); 177 176 } 178 177 ··· 221 222 } 222 223 223 224 if (margin < 31 || margin > 255) { 224 - pr_err("margin must be in range 31 - 255" 225 - " seconds, you tried to set %d\n", margin); 225 + pr_err("margin must be in range 31 - 255 seconds, you tried to set %d\n", 226 + margin); 226 227 err = -EINVAL; 227 228 goto err_margin; 228 229 } ··· 230 231 err = misc_register(&fitpc2_wdt_miscdev); 231 232 if (err) { 232 233 pr_err("cannot register miscdev on minor=%d (err=%d)\n", 233 - WATCHDOG_MINOR, err); 234 + WATCHDOG_MINOR, err); 234 235 goto err_margin; 235 236 } 236 237
+13 -17
drivers/watchdog/sc1200wdt.c
··· 31 31 * 32 32 */ 33 33 34 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 35 + 34 36 #include <linux/module.h> 35 37 #include <linux/moduleparam.h> 36 38 #include <linux/miscdevice.h> ··· 50 48 51 49 #define SC1200_MODULE_VER "build 20020303" 52 50 #define SC1200_MODULE_NAME "sc1200wdt" 53 - #define PFX SC1200_MODULE_NAME ": " 54 51 55 52 #define MAX_TIMEOUT 255 /* 255 minutes */ 56 53 #define PMIR (io) /* Power Management Index Register */ ··· 72 71 #define UART2_IRQ 0x04 /* Serial1 */ 73 72 /* 5 -7 are reserved */ 74 73 75 - static char banner[] __initdata = PFX SC1200_MODULE_VER; 76 74 static int timeout = 1; 77 75 static int io = -1; 78 76 static int io_len = 2; /* for non plug and play */ ··· 176 176 timeout = MAX_TIMEOUT; 177 177 178 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 181 return nonseekable_open(inode, file); 182 182 } ··· 254 254 { 255 255 if (expect_close == 42) { 256 256 sc1200wdt_stop(); 257 - printk(KERN_INFO PFX "Watchdog disabled\n"); 257 + pr_info("Watchdog disabled\n"); 258 258 } else { 259 259 sc1200wdt_write_data(WDTO, timeout); 260 - printk(KERN_CRIT PFX 261 - "Unexpected close!, timeout = %d min(s)\n", timeout); 260 + pr_crit("Unexpected close!, timeout = %d min(s)\n", timeout); 262 261 } 263 262 clear_bit(0, &open_flag); 264 263 expect_close = 0; ··· 360 361 io_len = pnp_port_len(wdt_dev, 0); 361 362 362 363 if (!request_region(io, io_len, SC1200_MODULE_NAME)) { 363 - printk(KERN_ERR PFX "Unable to register IO port %#x\n", io); 364 + pr_err("Unable to register IO port %#x\n", io); 364 365 return -EBUSY; 365 366 } 366 367 367 - printk(KERN_INFO "scl200wdt: PnP device found at io port %#x/%d\n", 368 - io, io_len); 368 + pr_info("PnP device found at io port %#x/%d\n", io, io_len); 369 369 return 0; 370 370 } 371 371 ··· 390 392 { 391 393 int ret; 392 394 393 - printk(KERN_INFO "%s\n", banner); 395 + pr_info("%s\n", SC1200_MODULE_VER); 394 396 395 397 #if defined CONFIG_PNP 396 398 if (isapnp) { ··· 401 403 #endif 402 404 403 405 if (io == -1) { 404 - printk(KERN_ERR PFX "io parameter must be specified\n"); 406 + pr_err("io parameter must be specified\n"); 405 407 ret = -EINVAL; 406 408 goto out_pnp; 407 409 } ··· 414 416 #endif 415 417 416 418 if (!request_region(io, io_len, SC1200_MODULE_NAME)) { 417 - printk(KERN_ERR PFX "Unable to register IO port %#x\n", io); 419 + pr_err("Unable to register IO port %#x\n", io); 418 420 ret = -EBUSY; 419 421 goto out_pnp; 420 422 } ··· 425 427 426 428 ret = register_reboot_notifier(&sc1200wdt_notifier); 427 429 if (ret) { 428 - printk(KERN_ERR PFX 429 - "Unable to register reboot notifier err = %d\n", ret); 430 + pr_err("Unable to register reboot notifier err = %d\n", ret); 430 431 goto out_io; 431 432 } 432 433 433 434 ret = misc_register(&sc1200wdt_miscdev); 434 435 if (ret) { 435 - printk(KERN_ERR PFX 436 - "Unable to register miscdev on minor %d\n", 437 - WATCHDOG_MINOR); 436 + pr_err("Unable to register miscdev on minor %d\n", 437 + WATCHDOG_MINOR); 438 438 goto out_rbt; 439 439 } 440 440
+14 -21
drivers/watchdog/sc520_wdt.c
··· 52 52 * This driver uses memory mapped IO, and spinlock. 53 53 */ 54 54 55 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 56 + 55 57 #include <linux/module.h> 56 58 #include <linux/moduleparam.h> 57 59 #include <linux/types.h> ··· 70 68 #include <linux/uaccess.h> 71 69 72 70 #include <asm/system.h> 73 - 74 - #define OUR_NAME "sc520_wdt" 75 - #define PFX OUR_NAME ": " 76 71 77 72 /* 78 73 * The AMD Elan SC520 timeout value is 492us times a power of 2 (0-7) ··· 150 151 /* Re-set the timer interval */ 151 152 mod_timer(&timer, jiffies + WDT_INTERVAL); 152 153 } else 153 - printk(KERN_WARNING PFX 154 - "Heartbeat lost! Will not ping the watchdog\n"); 154 + pr_warn("Heartbeat lost! Will not ping the watchdog\n"); 155 155 } 156 156 157 157 /* ··· 185 187 /* Start the watchdog */ 186 188 wdt_config(WDT_ENB | WDT_WRST_ENB | WDT_EXP_SEL_04); 187 189 188 - printk(KERN_INFO PFX "Watchdog timer is now enabled.\n"); 190 + pr_info("Watchdog timer is now enabled\n"); 189 191 return 0; 190 192 } 191 193 ··· 197 199 /* Stop the watchdog */ 198 200 wdt_config(0); 199 201 200 - printk(KERN_INFO PFX "Watchdog timer is now disabled...\n"); 202 + pr_info("Watchdog timer is now disabled...\n"); 201 203 return 0; 202 204 } 203 205 ··· 268 270 if (wdt_expect_close == 42) 269 271 wdt_turnoff(); 270 272 else { 271 - printk(KERN_CRIT PFX 272 - "Unexpected close, not stopping watchdog!\n"); 273 + pr_crit("Unexpected close, not stopping watchdog!\n"); 273 274 wdt_keepalive(); 274 275 } 275 276 clear_bit(0, &wdt_is_open); ··· 390 393 if not reset to the default */ 391 394 if (wdt_set_heartbeat(timeout)) { 392 395 wdt_set_heartbeat(WATCHDOG_TIMEOUT); 393 - printk(KERN_INFO PFX 394 - "timeout value must be 1 <= timeout <= 3600, using %d\n", 395 - WATCHDOG_TIMEOUT); 396 + pr_info("timeout value must be 1 <= timeout <= 3600, using %d\n", 397 + WATCHDOG_TIMEOUT); 396 398 } 397 399 398 400 wdtmrctl = ioremap(MMCR_BASE + OFFS_WDTMRCTL, 2); 399 401 if (!wdtmrctl) { 400 - printk(KERN_ERR PFX "Unable to remap memory\n"); 402 + pr_err("Unable to remap memory\n"); 401 403 rc = -ENOMEM; 402 404 goto err_out_region2; 403 405 } 404 406 405 407 rc = register_reboot_notifier(&wdt_notifier); 406 408 if (rc) { 407 - printk(KERN_ERR PFX 408 - "cannot register reboot notifier (err=%d)\n", rc); 409 + pr_err("cannot register reboot notifier (err=%d)\n", rc); 409 410 goto err_out_ioremap; 410 411 } 411 412 412 413 rc = misc_register(&wdt_miscdev); 413 414 if (rc) { 414 - printk(KERN_ERR PFX 415 - "cannot register miscdev on minor=%d (err=%d)\n", 416 - WATCHDOG_MINOR, rc); 415 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 416 + WATCHDOG_MINOR, rc); 417 417 goto err_out_notifier; 418 418 } 419 419 420 - printk(KERN_INFO PFX 421 - "WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n", 422 - timeout, nowayout); 420 + pr_info("WDT driver for SC520 initialised. timeout=%d sec (nowayout=%d)\n", 421 + timeout, nowayout); 423 422 424 423 return 0; 425 424
+6 -7
drivers/watchdog/sch311x_wdt.c
··· 18 18 * Includes, defines, variables, module parameters, ... 19 19 */ 20 20 21 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22 + 21 23 /* Includes */ 22 24 #include <linux/module.h> /* For module specific items */ 23 25 #include <linux/moduleparam.h> /* For new moduleparam's */ ··· 39 37 40 38 /* Module and version information */ 41 39 #define DRV_NAME "sch311x_wdt" 42 - #define PFX DRV_NAME ": " 43 40 44 41 /* Runtime registers */ 45 42 #define RESGEN 0x1d ··· 324 323 if (sch311x_wdt_expect_close == 42) { 325 324 sch311x_wdt_stop(); 326 325 } else { 327 - printk(KERN_CRIT PFX 328 - "Unexpected close, not stopping watchdog!\n"); 326 + pr_crit("Unexpected close, not stopping watchdog!\n"); 329 327 sch311x_wdt_keepalive(); 330 328 } 331 329 clear_bit(0, &sch311x_wdt_is_open); ··· 504 504 505 505 /* Check if Logical Device Register is currently active */ 506 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 509 /* Get the base address of the runtime registers */ 510 510 base_addr = (sch311x_sio_inb(sio_config_port, 0x60) << 8) | 511 511 sch311x_sio_inb(sio_config_port, 0x61); 512 512 if (!base_addr) { 513 - printk(KERN_ERR PFX "Base address not set.\n"); 513 + pr_err("Base address not set\n"); 514 514 err = -ENODEV; 515 515 goto exit; 516 516 } 517 517 *addr = base_addr; 518 518 519 - printk(KERN_INFO PFX "Found an SMSC SCH311%d chip at 0x%04x\n", 520 - dev_id, base_addr); 519 + pr_info("Found an SMSC SCH311%d chip at 0x%04x\n", dev_id, base_addr); 521 520 522 521 exit: 523 522 sch311x_sio_exit(sio_config_port);
+10 -11
drivers/watchdog/scx200_wdt.c
··· 17 17 of any nature resulting due to the use of this software. This 18 18 software is provided AS-IS with no warranties. */ 19 19 20 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 + 20 22 #include <linux/module.h> 21 23 #include <linux/moduleparam.h> 22 24 #include <linux/init.h> ··· 32 30 #include <linux/uaccess.h> 33 31 #include <linux/io.h> 34 32 35 - #define NAME "scx200_wdt" 33 + #define DEBUG 36 34 37 35 MODULE_AUTHOR("Christer Weinigel <wingel@nano-system.com>"); 38 36 MODULE_DESCRIPTION("NatSemi SCx200 Watchdog Driver"); ··· 68 66 69 67 static void scx200_wdt_update_margin(void) 70 68 { 71 - printk(KERN_INFO NAME ": timer margin %d seconds\n", margin); 69 + pr_info("timer margin %d seconds\n", margin); 72 70 wdto_restart = margin * W_SCALE; 73 71 } 74 72 75 73 static void scx200_wdt_enable(void) 76 74 { 77 - printk(KERN_DEBUG NAME ": enabling watchdog timer, wdto_restart = %d\n", 78 - wdto_restart); 75 + pr_debug("enabling watchdog timer, wdto_restart = %d\n", wdto_restart); 79 76 80 77 spin_lock(&scx_lock); 81 78 outw(0, scx200_cb_base + SCx200_WDT_WDTO); ··· 87 86 88 87 static void scx200_wdt_disable(void) 89 88 { 90 - printk(KERN_DEBUG NAME ": disabling watchdog timer\n"); 89 + pr_debug("disabling watchdog timer\n"); 91 90 92 91 spin_lock(&scx_lock); 93 92 outw(0, scx200_cb_base + SCx200_WDT_WDTO); ··· 109 108 static int scx200_wdt_release(struct inode *inode, struct file *file) 110 109 { 111 110 if (expect_close != 42) 112 - printk(KERN_WARNING NAME 113 - ": watchdog device closed unexpectedly, " 114 - "will not disable the watchdog timer\n"); 111 + pr_warn("watchdog device closed unexpectedly, will not disable the watchdog timer\n"); 115 112 else if (!nowayout) 116 113 scx200_wdt_disable(); 117 114 expect_close = 0; ··· 218 219 { 219 220 int r; 220 221 221 - printk(KERN_DEBUG NAME ": NatSemi SCx200 Watchdog Driver\n"); 222 + pr_debug("NatSemi SCx200 Watchdog Driver\n"); 222 223 223 224 /* check that we have found the configuration block */ 224 225 if (!scx200_cb_present()) ··· 227 228 if (!request_region(scx200_cb_base + SCx200_WDT_OFFSET, 228 229 SCx200_WDT_SIZE, 229 230 "NatSemi SCx200 Watchdog")) { 230 - printk(KERN_WARNING NAME ": watchdog I/O region busy\n"); 231 + pr_warn("watchdog I/O region busy\n"); 231 232 return -EBUSY; 232 233 } 233 234 ··· 236 237 237 238 r = register_reboot_notifier(&scx200_wdt_notifier); 238 239 if (r) { 239 - printk(KERN_ERR NAME ": unable to register reboot notifier"); 240 + pr_err("unable to register reboot notifier\n"); 240 241 release_region(scx200_cb_base + SCx200_WDT_OFFSET, 241 242 SCx200_WDT_SIZE); 242 243 return r;
+9 -6
drivers/watchdog/shwdt.c
··· 17 17 * Added expect close support, made emulated timeout runtime changeable 18 18 * general cleanups, add some ioctls 19 19 */ 20 + 21 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 22 + 20 23 #include <linux/module.h> 21 24 #include <linux/moduleparam.h> 22 25 #include <linux/platform_device.h> ··· 443 440 clock_division_ratio > 0x7)) { 444 441 clock_division_ratio = WTCSR_CKS_4096; 445 442 446 - pr_info("%s: divisor must be 0x5<=x<=0x7, using %d\n", 447 - DRV_NAME, clock_division_ratio); 443 + pr_info("divisor must be 0x5<=x<=0x7, using %d\n", 444 + clock_division_ratio); 448 445 } 449 446 450 447 rc = sh_wdt_set_heartbeat(heartbeat); 451 448 if (unlikely(rc)) { 452 449 heartbeat = WATCHDOG_HEARTBEAT; 453 450 454 - pr_info("%s: heartbeat value must be 1<=x<=3600, using %d\n", 455 - DRV_NAME, heartbeat); 451 + pr_info("heartbeat value must be 1<=x<=3600, using %d\n", 452 + heartbeat); 456 453 } 457 454 458 - pr_info("%s: configured with heartbeat=%d sec (nowayout=%d)\n", 459 - DRV_NAME, heartbeat, nowayout); 455 + pr_info("configured with heartbeat=%d sec (nowayout=%d)\n", 456 + heartbeat, nowayout); 460 457 461 458 return platform_driver_register(&sh_wdt_driver); 462 459 }
+16 -22
drivers/watchdog/smsc37b787_wdt.c
··· 43 43 * Documentation/watchdog/wdt.txt 44 44 */ 45 45 46 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 47 + 46 48 #include <linux/module.h> 47 49 #include <linux/moduleparam.h> 48 50 #include <linux/types.h> ··· 72 70 #define UNIT_SECOND 0 73 71 #define UNIT_MINUTE 1 74 72 75 - #define MODNAME "smsc37b787_wdt: " 76 73 #define VERSION "1.1" 77 74 78 75 #define IOPORT 0x3F0 ··· 364 363 /* Reload and activate timer */ 365 364 wb_smsc_wdt_enable(); 366 365 367 - printk(KERN_INFO MODNAME 368 - "Watchdog enabled. Timeout set to %d %s.\n", 366 + pr_info("Watchdog enabled. Timeout set to %d %s\n", 369 367 timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); 370 368 371 369 return nonseekable_open(inode, file); ··· 378 378 379 379 if (expect_close == 42) { 380 380 wb_smsc_wdt_disable(); 381 - printk(KERN_INFO MODNAME 382 - "Watchdog disabled, sleeping again...\n"); 381 + pr_info("Watchdog disabled, sleeping again...\n"); 383 382 } else { 384 - printk(KERN_CRIT MODNAME 385 - "Unexpected close, not stopping watchdog!\n"); 383 + pr_crit("Unexpected close, not stopping watchdog!\n"); 386 384 wb_smsc_wdt_reset_timer(); 387 385 } 388 386 ··· 532 534 { 533 535 int ret; 534 536 535 - printk(KERN_INFO "SMsC 37B787 watchdog component driver " 536 - VERSION " initialising...\n"); 537 + pr_info("SMsC 37B787 watchdog component driver " 538 + VERSION " initialising...\n"); 537 539 538 540 if (!request_region(IOPORT, IOPORT_SIZE, "SMsC 37B787 watchdog")) { 539 - printk(KERN_ERR MODNAME "Unable to register IO port %#x\n", 540 - IOPORT); 541 + pr_err("Unable to register IO port %#x\n", IOPORT); 541 542 ret = -EBUSY; 542 543 goto out_pnp; 543 544 } ··· 550 553 551 554 ret = register_reboot_notifier(&wb_smsc_wdt_notifier); 552 555 if (ret) { 553 - printk(KERN_ERR MODNAME 554 - "Unable to register reboot notifier err = %d\n", ret); 556 + pr_err("Unable to register reboot notifier err = %d\n", ret); 555 557 goto out_io; 556 558 } 557 559 558 560 ret = misc_register(&wb_smsc_wdt_miscdev); 559 561 if (ret) { 560 - printk(KERN_ERR MODNAME 561 - "Unable to register miscdev on minor %d\n", 562 - WATCHDOG_MINOR); 562 + pr_err("Unable to register miscdev on minor %d\n", 563 + WATCHDOG_MINOR); 563 564 goto out_rbt; 564 565 } 565 566 566 567 /* output info */ 567 - printk(KERN_INFO MODNAME "Timeout set to %d %s.\n", 568 + pr_info("Timeout set to %d %s\n", 568 569 timeout, (unit == UNIT_SECOND) ? "second(s)" : "minute(s)"); 569 - printk(KERN_INFO MODNAME 570 - "Watchdog initialized and sleeping (nowayout=%d)...\n", 571 - nowayout); 570 + pr_info("Watchdog initialized and sleeping (nowayout=%d)...\n", 571 + nowayout); 572 572 out_clean: 573 573 return ret; 574 574 ··· 586 592 /* Stop the timer before we leave */ 587 593 if (!nowayout) { 588 594 wb_smsc_wdt_shutdown(); 589 - printk(KERN_INFO MODNAME "Watchdog disabled.\n"); 595 + pr_info("Watchdog disabled\n"); 590 596 } 591 597 592 598 misc_deregister(&wb_smsc_wdt_miscdev); 593 599 unregister_reboot_notifier(&wb_smsc_wdt_notifier); 594 600 release_region(IOPORT, IOPORT_SIZE); 595 601 596 - printk(KERN_INFO "SMsC 37B787 watchdog component driver removed.\n"); 602 + pr_info("SMsC 37B787 watchdog component driver removed\n"); 597 603 } 598 604 599 605 module_init(wb_smsc_wdt_init);
+14 -21
drivers/watchdog/softdog.c
··· 36 36 * Added Matt Domsch's nowayout module option. 37 37 */ 38 38 39 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 40 + 39 41 #include <linux/module.h> 40 42 #include <linux/moduleparam.h> 41 43 #include <linux/types.h> ··· 51 49 #include <linux/jiffies.h> 52 50 #include <linux/uaccess.h> 53 51 #include <linux/kernel.h> 54 - 55 - #define PFX "SoftDog: " 56 52 57 53 #define TIMER_MARGIN 60 /* Default is 60 seconds */ 58 54 static int soft_margin = TIMER_MARGIN; /* in seconds */ ··· 103 103 module_put(THIS_MODULE); 104 104 105 105 if (soft_noboot) 106 - printk(KERN_CRIT PFX "Triggered - Reboot ignored.\n"); 106 + pr_crit("Triggered - Reboot ignored\n"); 107 107 else if (soft_panic) { 108 - printk(KERN_CRIT PFX "Initiating panic.\n"); 109 - panic("Software Watchdog Timer expired."); 108 + pr_crit("Initiating panic\n"); 109 + panic("Software Watchdog Timer expired"); 110 110 } else { 111 - printk(KERN_CRIT PFX "Initiating system reboot.\n"); 111 + pr_crit("Initiating system reboot\n"); 112 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 166 softdog_stop(); 167 167 module_put(THIS_MODULE); 168 168 } else { 169 - printk(KERN_CRIT PFX 170 - "Unexpected close, not stopping watchdog!\n"); 169 + pr_crit("Unexpected close, not stopping watchdog!\n"); 171 170 set_bit(0, &orphan_timer); 172 171 softdog_keepalive(); 173 172 } ··· 274 275 .notifier_call = softdog_notify_sys, 275 276 }; 276 277 277 - static char banner[] __initdata = KERN_INFO "Software Watchdog Timer: 0.07 " 278 - "initialized. soft_noboot=%d soft_margin=%d sec soft_panic=%d " 279 - "(nowayout= %d)\n"; 280 - 281 278 static int __init watchdog_init(void) 282 279 { 283 280 int ret; ··· 282 287 if not reset to the default */ 283 288 if (softdog_set_heartbeat(soft_margin)) { 284 289 softdog_set_heartbeat(TIMER_MARGIN); 285 - printk(KERN_INFO PFX 286 - "soft_margin must be 0 < soft_margin < 65536, using %d\n", 290 + pr_info("soft_margin must be 0 < soft_margin < 65536, using %d\n", 287 291 TIMER_MARGIN); 288 292 } 289 293 290 294 ret = register_reboot_notifier(&softdog_notifier); 291 295 if (ret) { 292 - printk(KERN_ERR PFX 293 - "cannot register reboot notifier (err=%d)\n", ret); 296 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 294 297 return ret; 295 298 } 296 299 297 300 ret = misc_register(&softdog_miscdev); 298 301 if (ret) { 299 - printk(KERN_ERR PFX 300 - "cannot register miscdev on minor=%d (err=%d)\n", 301 - WATCHDOG_MINOR, ret); 302 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 303 + WATCHDOG_MINOR, ret); 302 304 unregister_reboot_notifier(&softdog_notifier); 303 305 return ret; 304 306 } 305 307 306 - printk(banner, soft_noboot, soft_margin, soft_panic, nowayout); 308 + pr_info("Software Watchdog Timer: 0.07 initialized. soft_noboot=%d soft_margin=%d sec soft_panic=%d (nowayout= %d)\n", 309 + soft_noboot, soft_margin, soft_panic, nowayout); 307 310 308 311 return 0; 309 312 }
+13 -18
drivers/watchdog/sp5100_tco.c
··· 20 20 * Includes, defines, variables, module parameters, ... 21 21 */ 22 22 23 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 24 + 23 25 #include <linux/module.h> 24 26 #include <linux/moduleparam.h> 25 27 #include <linux/types.h> ··· 41 39 #define TCO_VERSION "0.01" 42 40 #define TCO_MODULE_NAME "SP5100 TCO timer" 43 41 #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION 44 - #define PFX TCO_MODULE_NAME ": " 45 42 46 43 /* internal variables */ 47 44 static u32 tcobase_phys; ··· 144 143 if (tco_expect_close == 42) { 145 144 tco_timer_stop(); 146 145 } else { 147 - printk(KERN_CRIT PFX 148 - "Unexpected close, not stopping watchdog!\n"); 146 + pr_crit("Unexpected close, not stopping watchdog!\n"); 149 147 tco_timer_keepalive(); 150 148 } 151 149 clear_bit(0, &timer_alive); ··· 290 290 /* Request the IO ports used by this driver */ 291 291 pm_iobase = SP5100_IO_PM_INDEX_REG; 292 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", 294 - pm_iobase); 293 + pr_err("I/O address 0x%04x already in use\n", pm_iobase); 295 294 goto exit; 296 295 } 297 296 ··· 307 308 308 309 if (!request_mem_region_exclusive(val, SP5100_WDT_MEM_MAP_SIZE, 309 310 "SP5100 TCO")) { 310 - printk(KERN_ERR PFX "mmio address 0x%04x already in use\n", 311 - val); 311 + pr_err("mmio address 0x%04x already in use\n", val); 312 312 goto unreg_region; 313 313 } 314 314 tcobase_phys = val; 315 315 316 316 tcobase = ioremap(val, SP5100_WDT_MEM_MAP_SIZE); 317 317 if (tcobase == 0) { 318 - printk(KERN_ERR PFX "failed to get tcobase address\n"); 318 + pr_err("failed to get tcobase address\n"); 319 319 goto unreg_mem_region; 320 320 } 321 321 ··· 373 375 return -ENODEV; 374 376 375 377 /* Check to see if last reboot was due to watchdog timeout */ 376 - printk(KERN_INFO PFX "Watchdog reboot %sdetected.\n", 377 - readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? 378 - "" : "not "); 378 + pr_info("Watchdog reboot %sdetected\n", 379 + readl(SP5100_WDT_CONTROL(tcobase)) & SP5100_PM_WATCHDOG_FIRED ? 380 + "" : "not "); 379 381 380 382 /* Clear out the old status */ 381 383 val = readl(SP5100_WDT_CONTROL(tcobase)); ··· 393 395 394 396 ret = misc_register(&sp5100_tco_miscdev); 395 397 if (ret != 0) { 396 - printk(KERN_ERR PFX "cannot register miscdev on minor=" 397 - "%d (err=%d)\n", 398 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 398 399 WATCHDOG_MINOR, ret); 399 400 goto exit; 400 401 } 401 402 402 403 clear_bit(0, &timer_alive); 403 404 404 - printk(KERN_INFO PFX "initialized (0x%p). heartbeat=%d sec" 405 - " (nowayout=%d)\n", 405 + pr_info("initialized (0x%p). heartbeat=%d sec (nowayout=%d)\n", 406 406 tcobase, heartbeat, nowayout); 407 407 408 408 return 0; ··· 451 455 { 452 456 int err; 453 457 454 - printk(KERN_INFO PFX "SP5100 TCO WatchDog Timer Driver v%s\n", 455 - TCO_VERSION); 458 + pr_info("SP5100 TCO WatchDog Timer Driver v%s\n", TCO_VERSION); 456 459 457 460 err = platform_driver_register(&sp5100_tco_driver); 458 461 if (err) ··· 475 480 { 476 481 platform_device_unregister(sp5100_tco_platform_device); 477 482 platform_driver_unregister(&sp5100_tco_driver); 478 - printk(KERN_INFO PFX "SP5100 TCO Watchdog Module Unloaded.\n"); 483 + pr_info("SP5100 TCO Watchdog Module Unloaded\n"); 479 484 } 480 485 481 486 module_init(sp5100_tco_init_module);
+4 -2
drivers/watchdog/stmp3xxx_wdt.c
··· 6 6 * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. 7 7 * Copyright 2008 Embedded Alley Solutions, Inc All Rights Reserved. 8 8 */ 9 + 10 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 11 + 9 12 #include <linux/init.h> 10 13 #include <linux/kernel.h> 11 14 #include <linux/fs.h> ··· 224 221 return ret; 225 222 } 226 223 227 - printk(KERN_INFO "stmp3xxx watchdog: initialized, heartbeat %d sec\n", 228 - heartbeat); 224 + pr_info("initialized, heartbeat %d sec\n", heartbeat); 229 225 230 226 return ret; 231 227 }
+6 -5
drivers/watchdog/txx9wdt.c
··· 7 7 * it under the terms of the GNU General Public License version 2 as 8 8 * published by the Free Software Foundation. 9 9 */ 10 + 11 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 12 + 10 13 #include <linux/module.h> 11 14 #include <linux/moduleparam.h> 12 15 #include <linux/types.h> ··· 99 96 if (expect_close) 100 97 txx9wdt_stop(); 101 98 else { 102 - printk(KERN_CRIT "txx9wdt: " 103 - "Unexpected close, not stopping watchdog!\n"); 99 + pr_crit("Unexpected close, not stopping watchdog!\n"); 104 100 txx9wdt_ping(); 105 101 } 106 102 clear_bit(0, &txx9wdt_alive); ··· 215 213 goto exit; 216 214 } 217 215 218 - printk(KERN_INFO "Hardware Watchdog Timer for TXx9: " 219 - "timeout=%d sec (max %ld) (nowayout= %d)\n", 220 - timeout, WD_MAX_TIMEOUT, nowayout); 216 + pr_info("Hardware Watchdog Timer: timeout=%d sec (max %ld) (nowayout= %d)\n", 217 + timeout, WD_MAX_TIMEOUT, nowayout); 221 218 222 219 return 0; 223 220 exit_busy:
+3
drivers/watchdog/via_wdt.c
··· 10 10 * Caveat: PnP must be enabled in BIOS to allow full access to watchdog 11 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 16 #include <linux/device.h> 14 17 #include <linux/io.h> 15 18 #include <linux/jiffies.h>
+14 -20
drivers/watchdog/w83627hf_wdt.c
··· 26 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 31 #include <linux/module.h> 30 32 #include <linux/moduleparam.h> 31 33 #include <linux/types.h> ··· 45 43 #include <asm/system.h> 46 44 47 45 #define WATCHDOG_NAME "w83627hf/thf/hg/dhg WDT" 48 - #define PFX WATCHDOG_NAME ": " 49 46 #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ 50 47 51 48 static unsigned long wdt_is_open; ··· 120 119 outb_p(0xF6, WDT_EFER); /* Select CRF6 */ 121 120 t = inb_p(WDT_EFDR); /* read CRF6 */ 122 121 if (t != 0) { 123 - printk(KERN_INFO PFX 124 - "Watchdog already running. Resetting timeout to %d sec\n", 125 - timeout); 122 + pr_info("Watchdog already running. Resetting timeout to %d sec\n", 123 + timeout); 126 124 outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ 127 125 } 128 126 ··· 290 290 if (expect_close == 42) 291 291 wdt_disable(); 292 292 else { 293 - printk(KERN_CRIT PFX 294 - "Unexpected close, not stopping watchdog!\n"); 293 + pr_crit("Unexpected close, not stopping watchdog!\n"); 295 294 wdt_ping(); 296 295 } 297 296 expect_close = 0; ··· 343 344 { 344 345 int ret; 345 346 346 - printk(KERN_INFO "WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising.\n"); 347 + pr_info("WDT driver for the Winbond(TM) W83627HF/THF/HG/DHG Super I/O chip initialising\n"); 347 348 348 349 if (wdt_set_heartbeat(timeout)) { 349 350 wdt_set_heartbeat(WATCHDOG_TIMEOUT); 350 - printk(KERN_INFO PFX 351 - "timeout value must be 1 <= timeout <= 255, using %d\n", 352 - WATCHDOG_TIMEOUT); 351 + pr_info("timeout value must be 1 <= timeout <= 255, using %d\n", 352 + WATCHDOG_TIMEOUT); 353 353 } 354 354 355 355 if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { 356 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 357 - wdt_io); 356 + pr_err("I/O address 0x%04x already in use\n", wdt_io); 358 357 ret = -EIO; 359 358 goto out; 360 359 } ··· 361 364 362 365 ret = register_reboot_notifier(&wdt_notifier); 363 366 if (ret != 0) { 364 - printk(KERN_ERR PFX 365 - "cannot register reboot notifier (err=%d)\n", ret); 367 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 366 368 goto unreg_regions; 367 369 } 368 370 369 371 ret = misc_register(&wdt_miscdev); 370 372 if (ret != 0) { 371 - printk(KERN_ERR PFX 372 - "cannot register miscdev on minor=%d (err=%d)\n", 373 - WATCHDOG_MINOR, ret); 373 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 374 + WATCHDOG_MINOR, ret); 374 375 goto unreg_reboot; 375 376 } 376 377 377 - printk(KERN_INFO PFX 378 - "initialized. timeout=%d sec (nowayout=%d)\n", 379 - timeout, nowayout); 378 + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", 379 + timeout, nowayout); 380 380 381 381 out: 382 382 return ret;
+16 -23
drivers/watchdog/w83697hf_wdt.c
··· 25 25 * "AS-IS" and at no charge. 26 26 */ 27 27 28 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 29 + 28 30 #include <linux/module.h> 29 31 #include <linux/moduleparam.h> 30 32 #include <linux/types.h> ··· 44 42 #include <asm/system.h> 45 43 46 44 #define WATCHDOG_NAME "w83697hf/hg WDT" 47 - #define PFX WATCHDOG_NAME ": " 48 45 #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ 49 46 #define WATCHDOG_EARLY_DISABLE 1 /* Disable until userland kicks in */ 50 47 ··· 310 309 if (expect_close == 42) 311 310 wdt_disable(); 312 311 else { 313 - printk(KERN_CRIT PFX 314 - "Unexpected close, not stopping watchdog!\n"); 312 + pr_crit("Unexpected close, not stopping watchdog!\n"); 315 313 wdt_ping(); 316 314 } 317 315 expect_close = 0; ··· 362 362 static int w83697hf_check_wdt(void) 363 363 { 364 364 if (!request_region(wdt_io, 2, WATCHDOG_NAME)) { 365 - printk(KERN_ERR PFX 366 - "I/O address 0x%x already in use\n", wdt_io); 365 + pr_err("I/O address 0x%x already in use\n", wdt_io); 367 366 return -EIO; 368 367 } 369 368 370 - printk(KERN_DEBUG PFX 371 - "Looking for watchdog at address 0x%x\n", wdt_io); 369 + pr_debug("Looking for watchdog at address 0x%x\n", wdt_io); 372 370 w83697hf_unlock(); 373 371 if (w83697hf_get_reg(0x20) == 0x60) { 374 - printk(KERN_INFO PFX 375 - "watchdog found at address 0x%x\n", wdt_io); 372 + pr_info("watchdog found at address 0x%x\n", wdt_io); 376 373 w83697hf_lock(); 377 374 return 0; 378 375 } 379 376 /* Reprotect in case it was a compatible device */ 380 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 380 release_region(wdt_io, 2); 384 381 return -EIO; 385 382 } ··· 387 390 { 388 391 int ret, i, found = 0; 389 392 390 - printk(KERN_INFO PFX "WDT driver for W83697HF/HG initializing\n"); 393 + pr_info("WDT driver for W83697HF/HG initializing\n"); 391 394 392 395 if (wdt_io == 0) { 393 396 /* we will autodetect the W83697HF/HG watchdog */ ··· 402 405 } 403 406 404 407 if (!found) { 405 - printk(KERN_ERR PFX "No W83697HF/HG could be found\n"); 408 + pr_err("No W83697HF/HG could be found\n"); 406 409 ret = -EIO; 407 410 goto out; 408 411 } ··· 410 413 w83697hf_init(); 411 414 if (early_disable) { 412 415 if (wdt_running()) 413 - printk(KERN_WARNING PFX "Stopping previously enabled " 414 - "watchdog until userland kicks in\n"); 416 + pr_warn("Stopping previously enabled watchdog until userland kicks in\n"); 415 417 wdt_disable(); 416 418 } 417 419 418 420 if (wdt_set_heartbeat(timeout)) { 419 421 wdt_set_heartbeat(WATCHDOG_TIMEOUT); 420 - printk(KERN_INFO PFX 421 - "timeout value must be 1 <= timeout <= 255, using %d\n", 422 - WATCHDOG_TIMEOUT); 422 + pr_info("timeout value must be 1 <= timeout <= 255, using %d\n", 423 + WATCHDOG_TIMEOUT); 423 424 } 424 425 425 426 ret = register_reboot_notifier(&wdt_notifier); 426 427 if (ret != 0) { 427 - printk(KERN_ERR PFX 428 - "cannot register reboot notifier (err=%d)\n", ret); 428 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 429 429 goto unreg_regions; 430 430 } 431 431 432 432 ret = misc_register(&wdt_miscdev); 433 433 if (ret != 0) { 434 - printk(KERN_ERR PFX 435 - "cannot register miscdev on minor=%d (err=%d)\n", 436 - WATCHDOG_MINOR, ret); 434 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 435 + WATCHDOG_MINOR, ret); 437 436 goto unreg_reboot; 438 437 } 439 438 440 - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", 439 + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", 441 440 timeout, nowayout); 442 441 443 442 out:
+15 -19
drivers/watchdog/w83697ug_wdt.c
··· 30 30 * (c) Copyright 1995 Alan Cox <alan@redhat.com> 31 31 */ 32 32 33 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 34 + 33 35 #include <linux/module.h> 34 36 #include <linux/moduleparam.h> 35 37 #include <linux/types.h> ··· 49 47 #include <asm/system.h> 50 48 51 49 #define WATCHDOG_NAME "w83697ug/uf WDT" 52 - #define PFX WATCHDOG_NAME ": " 53 50 #define WATCHDOG_TIMEOUT 60 /* 60 sec default timeout */ 54 51 55 52 static unsigned long wdt_is_open; ··· 92 91 version = inb(WDT_EFDR); 93 92 94 93 if (version == 0x68) { /* W83697UG */ 95 - printk(KERN_INFO PFX "Watchdog chip version 0x%02x = " 96 - "W83697UG/UF found at 0x%04x\n", version, wdt_io); 94 + pr_info("Watchdog chip version 0x%02x = W83697UG/UF found at 0x%04x\n", 95 + version, wdt_io); 97 96 98 97 outb_p(0x2b, WDT_EFER); 99 98 c = inb_p(WDT_EFDR); /* select WDT0 */ ··· 102 101 outb_p(c, WDT_EFDR); /* set pin118 to WDT0 */ 103 102 104 103 } else { 105 - printk(KERN_ERR PFX "No W83697UG/UF could be found\n"); 104 + pr_err("No W83697UG/UF could be found\n"); 106 105 return -ENODEV; 107 106 } 108 107 ··· 132 131 outb_p(0xF6, WDT_EFER); /* Select CRF6 */ 133 132 t = inb_p(WDT_EFDR); /* read CRF6 */ 134 133 if (t != 0) { 135 - printk(KERN_INFO PFX "Watchdog already running." 136 - " Resetting timeout to %d sec\n", timeout); 134 + pr_info("Watchdog already running. Resetting timeout to %d sec\n", 135 + timeout); 137 136 outb_p(timeout, WDT_EFDR); /* Write back to CRF6 */ 138 137 } 139 138 outb_p(0xF5, WDT_EFER); /* Select CRF5 */ ··· 287 286 if (expect_close == 42) 288 287 wdt_disable(); 289 288 else { 290 - printk(KERN_CRIT PFX 291 - "Unexpected close, not stopping watchdog!\n"); 289 + pr_crit("Unexpected close, not stopping watchdog!\n"); 292 290 wdt_ping(); 293 291 } 294 292 expect_close = 0; ··· 340 340 { 341 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 345 if (wdt_set_heartbeat(timeout)) { 346 346 wdt_set_heartbeat(WATCHDOG_TIMEOUT); 347 - printk(KERN_INFO PFX 348 - "timeout value must be 1<=timeout<=255, using %d\n", 347 + pr_info("timeout value must be 1<=timeout<=255, using %d\n", 349 348 WATCHDOG_TIMEOUT); 350 349 } 351 350 352 351 if (!request_region(wdt_io, 1, WATCHDOG_NAME)) { 353 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 354 - wdt_io); 352 + pr_err("I/O address 0x%04x already in use\n", wdt_io); 355 353 ret = -EIO; 356 354 goto out; 357 355 } ··· 360 362 361 363 ret = register_reboot_notifier(&wdt_notifier); 362 364 if (ret != 0) { 363 - printk(KERN_ERR PFX 364 - "cannot register reboot notifier (err=%d)\n", ret); 365 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 365 366 goto unreg_regions; 366 367 } 367 368 368 369 ret = misc_register(&wdt_miscdev); 369 370 if (ret != 0) { 370 - printk(KERN_ERR PFX 371 - "cannot register miscdev on minor=%d (err=%d)\n", 372 - WATCHDOG_MINOR, ret); 371 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 372 + WATCHDOG_MINOR, ret); 373 373 goto unreg_reboot; 374 374 } 375 375 376 - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", 376 + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", 377 377 timeout, nowayout); 378 378 379 379 out:
+15 -21
drivers/watchdog/w83877f_wdt.c
··· 42 42 * daemon always getting scheduled within that time frame. 43 43 */ 44 44 45 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 46 + 45 47 #include <linux/module.h> 46 48 #include <linux/moduleparam.h> 47 49 #include <linux/types.h> ··· 61 59 #include <asm/system.h> 62 60 63 61 #define OUR_NAME "w83877f_wdt" 64 - #define PFX OUR_NAME ": " 65 62 66 63 #define ENABLE_W83877F_PORT 0x3F0 67 64 #define ENABLE_W83877F 0x87 ··· 127 126 spin_unlock(&wdt_spinlock); 128 127 129 128 } else 130 - printk(KERN_WARNING PFX 131 - "Heartbeat lost! Will not ping the watchdog\n"); 129 + pr_warn("Heartbeat lost! Will not ping the watchdog\n"); 132 130 } 133 131 134 132 /* ··· 165 165 166 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 171 static void wdt_turnoff(void) ··· 175 175 176 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 181 static void wdt_keepalive(void) ··· 234 234 wdt_turnoff(); 235 235 else { 236 236 del_timer(&timer); 237 - printk(KERN_CRIT PFX 238 - "device file closed unexpectedly. Will not stop the WDT!\n"); 237 + pr_crit("device file closed unexpectedly. Will not stop the WDT!\n"); 239 238 } 240 239 clear_bit(0, &wdt_is_open); 241 240 wdt_expect_close = 0; ··· 356 357 357 358 if (timeout < 1 || timeout > 3600) { /* arbitrary upper limit */ 358 359 timeout = WATCHDOG_TIMEOUT; 359 - printk(KERN_INFO PFX 360 - "timeout value must be 1 <= x <= 3600, using %d\n", 361 - timeout); 360 + pr_info("timeout value must be 1 <= x <= 3600, using %d\n", 361 + timeout); 362 362 } 363 363 364 364 if (!request_region(ENABLE_W83877F_PORT, 2, "W83877F WDT")) { 365 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 366 - ENABLE_W83877F_PORT); 365 + pr_err("I/O address 0x%04x already in use\n", 366 + ENABLE_W83877F_PORT); 367 367 rc = -EIO; 368 368 goto err_out; 369 369 } 370 370 371 371 if (!request_region(WDT_PING, 1, "W8387FF WDT")) { 372 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 373 - WDT_PING); 372 + pr_err("I/O address 0x%04x already in use\n", WDT_PING); 374 373 rc = -EIO; 375 374 goto err_out_region1; 376 375 } 377 376 378 377 rc = register_reboot_notifier(&wdt_notifier); 379 378 if (rc) { 380 - printk(KERN_ERR PFX 381 - "cannot register reboot notifier (err=%d)\n", rc); 379 + pr_err("cannot register reboot notifier (err=%d)\n", rc); 382 380 goto err_out_region2; 383 381 } 384 382 385 383 rc = misc_register(&wdt_miscdev); 386 384 if (rc) { 387 - printk(KERN_ERR PFX 388 - "cannot register miscdev on minor=%d (err=%d)\n", 389 - wdt_miscdev.minor, rc); 385 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 386 + wdt_miscdev.minor, rc); 390 387 goto err_out_reboot; 391 388 } 392 389 393 - printk(KERN_INFO PFX 394 - "WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n", 390 + pr_info("WDT driver for W83877F initialised. timeout=%d sec (nowayout=%d)\n", 395 391 timeout, nowayout); 396 392 397 393 return 0;
+14 -20
drivers/watchdog/w83977f_wdt.c
··· 15 15 * 16 16 */ 17 17 18 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 19 + 18 20 #include <linux/module.h> 19 21 #include <linux/moduleparam.h> 20 22 #include <linux/types.h> ··· 35 33 36 34 #define WATCHDOG_VERSION "1.00" 37 35 #define WATCHDOG_NAME "W83977F WDT" 38 - #define PFX WATCHDOG_NAME ": " 39 - #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" 40 36 41 37 #define IO_INDEX_PORT 0x3F0 42 38 #define IO_DATA_PORT (IO_INDEX_PORT+1) ··· 131 131 132 132 spin_unlock_irqrestore(&spinlock, flags); 133 133 134 - printk(KERN_INFO PFX "activated.\n"); 134 + pr_info("activated\n"); 135 135 136 136 return 0; 137 137 } ··· 185 185 186 186 spin_unlock_irqrestore(&spinlock, flags); 187 187 188 - printk(KERN_INFO PFX "shutdown.\n"); 188 + pr_info("shutdown\n"); 189 189 190 190 return 0; 191 191 } ··· 313 313 clear_bit(0, &timer_alive); 314 314 } else { 315 315 wdt_keepalive(); 316 - printk(KERN_CRIT PFX 317 - "unexpected close, not stopping watchdog!\n"); 316 + pr_crit("unexpected close, not stopping watchdog!\n"); 318 317 } 319 318 expect_close = 0; 320 319 return 0; ··· 470 471 { 471 472 int rc; 472 473 473 - printk(KERN_INFO PFX DRIVER_VERSION); 474 + pr_info("driver v%s\n", WATCHDOG_VERSION); 474 475 475 476 /* 476 477 * Check that the timeout value is within it's range; ··· 478 479 */ 479 480 if (wdt_set_timeout(timeout)) { 480 481 wdt_set_timeout(DEFAULT_TIMEOUT); 481 - printk(KERN_INFO PFX 482 - "timeout value must be 15 <= timeout <= 7635, using %d\n", 483 - DEFAULT_TIMEOUT); 482 + pr_info("timeout value must be 15 <= timeout <= 7635, using %d\n", 483 + DEFAULT_TIMEOUT); 484 484 } 485 485 486 486 if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { 487 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 488 - IO_INDEX_PORT); 487 + pr_err("I/O address 0x%04x already in use\n", IO_INDEX_PORT); 489 488 rc = -EIO; 490 489 goto err_out; 491 490 } 492 491 493 492 rc = register_reboot_notifier(&wdt_notifier); 494 493 if (rc) { 495 - printk(KERN_ERR PFX 496 - "cannot register reboot notifier (err=%d)\n", rc); 494 + pr_err("cannot register reboot notifier (err=%d)\n", rc); 497 495 goto err_out_region; 498 496 } 499 497 500 498 rc = misc_register(&wdt_miscdev); 501 499 if (rc) { 502 - printk(KERN_ERR PFX 503 - "cannot register miscdev on minor=%d (err=%d)\n", 504 - wdt_miscdev.minor, rc); 500 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 501 + wdt_miscdev.minor, rc); 505 502 goto err_out_reboot; 506 503 } 507 504 508 - printk(KERN_INFO PFX 509 - "initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", 510 - timeout, nowayout, testmode); 505 + pr_info("initialized. timeout=%d sec (nowayout=%d testmode=%d)\n", 506 + timeout, nowayout, testmode); 511 507 512 508 return 0; 513 509
+12 -18
drivers/watchdog/wafer5823wdt.c
··· 26 26 * 27 27 */ 28 28 29 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 30 + 29 31 #include <linux/module.h> 30 32 #include <linux/moduleparam.h> 31 33 #include <linux/miscdevice.h> ··· 205 203 if (expect_close == 42) 206 204 wafwdt_stop(); 207 205 else { 208 - printk(KERN_CRIT PFX 209 - "WDT device closed unexpectedly. WDT will not stop!\n"); 206 + pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); 210 207 wafwdt_ping(); 211 208 } 212 209 clear_bit(0, &wafwdt_is_open); ··· 257 256 { 258 257 int ret; 259 258 260 - printk(KERN_INFO 261 - "WDT driver for Wafer 5823 single board computer initialising.\n"); 259 + pr_info("WDT driver for Wafer 5823 single board computer initialising\n"); 262 260 263 261 if (timeout < 1 || timeout > 255) { 264 262 timeout = WD_TIMO; 265 - printk(KERN_INFO PFX 266 - "timeout value must be 1 <= x <= 255, using %d\n", 267 - timeout); 263 + pr_info("timeout value must be 1 <= x <= 255, using %d\n", 264 + timeout); 268 265 } 269 266 270 267 if (wdt_stop != wdt_start) { 271 268 if (!request_region(wdt_stop, 1, "Wafer 5823 WDT")) { 272 - printk(KERN_ERR PFX 273 - "I/O address 0x%04x already in use\n", 274 - wdt_stop); 269 + pr_err("I/O address 0x%04x already in use\n", wdt_stop); 275 270 ret = -EIO; 276 271 goto error; 277 272 } 278 273 } 279 274 280 275 if (!request_region(wdt_start, 1, "Wafer 5823 WDT")) { 281 - printk(KERN_ERR PFX "I/O address 0x%04x already in use\n", 282 - wdt_start); 276 + pr_err("I/O address 0x%04x already in use\n", wdt_start); 283 277 ret = -EIO; 284 278 goto error2; 285 279 } 286 280 287 281 ret = register_reboot_notifier(&wafwdt_notifier); 288 282 if (ret != 0) { 289 - printk(KERN_ERR PFX 290 - "cannot register reboot notifier (err=%d)\n", ret); 283 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 291 284 goto error3; 292 285 } 293 286 294 287 ret = misc_register(&wafwdt_miscdev); 295 288 if (ret != 0) { 296 - printk(KERN_ERR PFX 297 - "cannot register miscdev on minor=%d (err=%d)\n", 298 - WATCHDOG_MINOR, ret); 289 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 290 + WATCHDOG_MINOR, ret); 299 291 goto error4; 300 292 } 301 293 302 - printk(KERN_INFO PFX "initialized. timeout=%d sec (nowayout=%d)\n", 294 + pr_info("initialized. timeout=%d sec (nowayout=%d)\n", 303 295 timeout, nowayout); 304 296 305 297 return ret;
+2 -2
drivers/watchdog/watchdog_core.c
··· 77 77 /* We only support 1 watchdog device via the /dev/watchdog interface */ 78 78 ret = watchdog_dev_register(wdd); 79 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 81 return ret; 82 82 } 83 83 ··· 101 101 102 102 ret = watchdog_dev_unregister(wdd); 103 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 106 EXPORT_SYMBOL_GPL(watchdog_unregister_device); 107 107
+5 -5
drivers/watchdog/watchdog_dev.c
··· 347 347 348 348 /* Only one device can register for /dev/watchdog */ 349 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 351 return -EBUSY; 352 352 } 353 353 ··· 355 355 356 356 err = misc_register(&watchdog_miscdev); 357 357 if (err != 0) { 358 - pr_err("%s: cannot register miscdev on minor=%d (err=%d).\n", 359 - watchdog->info->identity, WATCHDOG_MINOR, err); 358 + pr_err("%s: cannot register miscdev on minor=%d (err=%d)\n", 359 + watchdog->info->identity, WATCHDOG_MINOR, err); 360 360 goto out; 361 361 } 362 362 ··· 383 383 384 384 /* We can only unregister the watchdog device that was registered */ 385 385 if (watchdog != wdd) { 386 - pr_err("%s: watchdog was not registered as /dev/watchdog.\n", 387 - watchdog->info->identity); 386 + pr_err("%s: watchdog was not registered as /dev/watchdog\n", 387 + watchdog->info->identity); 388 388 return -ENODEV; 389 389 } 390 390
+29 -40
drivers/watchdog/wdrtas.c
··· 26 26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 27 27 */ 28 28 29 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 30 + 29 31 #include <linux/fs.h> 30 32 #include <linux/init.h> 31 33 #include <linux/kernel.h> ··· 95 93 result = rtas_call(wdrtas_token_set_indicator, 3, 1, NULL, 96 94 WDRTAS_SURVEILLANCE_IND, 0, interval); 97 95 if (result < 0 && print_msg) { 98 - printk(KERN_ERR "wdrtas: setting the watchdog to %i " 99 - "timeout failed: %li\n", interval, result); 96 + pr_err("setting the watchdog to %i timeout failed: %li\n", 97 + interval, result); 100 98 print_msg--; 101 99 } 102 100 ··· 130 128 spin_unlock(&rtas_data_buf_lock); 131 129 132 130 if (value[0] != 0 || value[1] != 2 || value[3] != 0 || result < 0) { 133 - printk(KERN_WARNING "wdrtas: could not get sp_spi watchdog " 134 - "timeout (%li). Continuing\n", result); 131 + pr_warn("could not get sp_spi watchdog timeout (%li). Continuing\n", 132 + result); 135 133 return fallback_value; 136 134 } 137 135 ··· 172 170 int i; 173 171 174 172 for (i = 0; i < WDRTAS_LOGBUFFER_LEN; i += 16) 175 - printk(KERN_INFO "wdrtas: dumping event (line %i/%i), data = " 176 - "%02x %02x %02x %02x %02x %02x %02x %02x " 177 - "%02x %02x %02x %02x %02x %02x %02x %02x\n", 178 - (i / 16) + 1, (WDRTAS_LOGBUFFER_LEN / 16), 179 - wdrtas_logbuffer[i + 0], wdrtas_logbuffer[i + 1], 180 - wdrtas_logbuffer[i + 2], wdrtas_logbuffer[i + 3], 181 - wdrtas_logbuffer[i + 4], wdrtas_logbuffer[i + 5], 182 - wdrtas_logbuffer[i + 6], wdrtas_logbuffer[i + 7], 183 - wdrtas_logbuffer[i + 8], wdrtas_logbuffer[i + 9], 184 - wdrtas_logbuffer[i + 10], wdrtas_logbuffer[i + 11], 185 - wdrtas_logbuffer[i + 12], wdrtas_logbuffer[i + 13], 186 - wdrtas_logbuffer[i + 14], wdrtas_logbuffer[i + 15]); 173 + pr_info("dumping event (line %i/%i), data = " 174 + "%02x %02x %02x %02x %02x %02x %02x %02x " 175 + "%02x %02x %02x %02x %02x %02x %02x %02x\n", 176 + (i / 16) + 1, (WDRTAS_LOGBUFFER_LEN / 16), 177 + wdrtas_logbuffer[i + 0], wdrtas_logbuffer[i + 1], 178 + wdrtas_logbuffer[i + 2], wdrtas_logbuffer[i + 3], 179 + wdrtas_logbuffer[i + 4], wdrtas_logbuffer[i + 5], 180 + wdrtas_logbuffer[i + 6], wdrtas_logbuffer[i + 7], 181 + wdrtas_logbuffer[i + 8], wdrtas_logbuffer[i + 9], 182 + wdrtas_logbuffer[i + 10], wdrtas_logbuffer[i + 11], 183 + wdrtas_logbuffer[i + 12], wdrtas_logbuffer[i + 13], 184 + wdrtas_logbuffer[i + 14], wdrtas_logbuffer[i + 15]); 187 185 } 188 186 189 187 /** ··· 203 201 (void *)__pa(wdrtas_logbuffer), 204 202 WDRTAS_LOGBUFFER_LEN); 205 203 if (result < 0) 206 - printk(KERN_ERR "wdrtas: event-scan failed: %li\n", 207 - result); 204 + pr_err("event-scan failed: %li\n", result); 208 205 if (result == 0) 209 206 wdrtas_log_scanned_event(); 210 207 } while (result == 0); ··· 225 224 result = rtas_get_sensor(WDRTAS_THERMAL_SENSOR, 0, &temperature); 226 225 227 226 if (result < 0) 228 - printk(KERN_WARNING "wdrtas: reading the thermal sensor " 229 - "failed: %i\n", result); 227 + pr_warn("reading the thermal sensor failed: %i\n", result); 230 228 else 231 229 temperature = ((temperature * 9) / 5) + 32; /* fahrenheit */ 232 230 ··· 419 419 if (wdrtas_expect_close == WDRTAS_MAGIC_CHAR) 420 420 wdrtas_timer_stop(); 421 421 else { 422 - printk(KERN_WARNING "wdrtas: got unexpected close. Watchdog " 423 - "not stopped.\n"); 422 + pr_warn("got unexpected close. Watchdog not stopped.\n"); 424 423 wdrtas_timer_keepalive(); 425 424 } 426 425 ··· 551 552 { 552 553 wdrtas_token_get_sensor_state = rtas_token("get-sensor-state"); 553 554 if (wdrtas_token_get_sensor_state == RTAS_UNKNOWN_SERVICE) { 554 - printk(KERN_WARNING "wdrtas: couldn't get token for " 555 - "get-sensor-state. Trying to continue without " 556 - "temperature support.\n"); 555 + pr_warn("couldn't get token for get-sensor-state. Trying to continue without temperature support.\n"); 557 556 } 558 557 559 558 wdrtas_token_get_sp = rtas_token("ibm,get-system-parameter"); 560 559 if (wdrtas_token_get_sp == RTAS_UNKNOWN_SERVICE) { 561 - printk(KERN_WARNING "wdrtas: couldn't get token for " 562 - "ibm,get-system-parameter. Trying to continue with " 563 - "a default timeout value of %i seconds.\n", 564 - WDRTAS_DEFAULT_INTERVAL); 560 + pr_warn("couldn't get token for ibm,get-system-parameter. Trying to continue with a default timeout value of %i seconds.\n", 561 + WDRTAS_DEFAULT_INTERVAL); 565 562 } 566 563 567 564 wdrtas_token_set_indicator = rtas_token("set-indicator"); 568 565 if (wdrtas_token_set_indicator == RTAS_UNKNOWN_SERVICE) { 569 - printk(KERN_ERR "wdrtas: couldn't get token for " 570 - "set-indicator. Terminating watchdog code.\n"); 566 + pr_err("couldn't get token for set-indicator. Terminating watchdog code.\n"); 571 567 return -EIO; 572 568 } 573 569 574 570 wdrtas_token_event_scan = rtas_token("event-scan"); 575 571 if (wdrtas_token_event_scan == RTAS_UNKNOWN_SERVICE) { 576 - printk(KERN_ERR "wdrtas: couldn't get token for event-scan. " 577 - "Terminating watchdog code.\n"); 572 + pr_err("couldn't get token for event-scan. Terminating watchdog code.\n"); 578 573 return -EIO; 579 574 } 580 575 ··· 602 609 603 610 result = misc_register(&wdrtas_miscdev); 604 611 if (result) { 605 - printk(KERN_ERR "wdrtas: couldn't register watchdog misc " 606 - "device. Terminating watchdog code.\n"); 612 + pr_err("couldn't register watchdog misc device. Terminating watchdog code.\n"); 607 613 return result; 608 614 } 609 615 610 616 if (wdrtas_token_get_sensor_state != RTAS_UNKNOWN_SERVICE) { 611 617 result = misc_register(&wdrtas_tempdev); 612 618 if (result) { 613 - printk(KERN_WARNING "wdrtas: couldn't register " 614 - "watchdog temperature misc device. Continuing " 615 - "without temperature support.\n"); 619 + pr_warn("couldn't register watchdog temperature misc device. Continuing without temperature support.\n"); 616 620 wdrtas_token_get_sensor_state = RTAS_UNKNOWN_SERVICE; 617 621 } 618 622 } ··· 633 643 return -ENODEV; 634 644 635 645 if (register_reboot_notifier(&wdrtas_notifier)) { 636 - printk(KERN_ERR "wdrtas: could not register reboot notifier. " 637 - "Terminating watchdog code.\n"); 646 + pr_err("could not register reboot notifier. Terminating watchdog code.\n"); 638 647 wdrtas_unregister_devs(); 639 648 return -ENODEV; 640 649 }
+24 -27
drivers/watchdog/wdt.c
··· 32 32 * Matt Domsch : Added nowayout module option 33 33 */ 34 34 35 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 36 + 35 37 #include <linux/interrupt.h> 36 38 #include <linux/module.h> 37 39 #include <linux/moduleparam.h> ··· 254 252 static void wdt_decode_501(int status) 255 253 { 256 254 if (!(status & WDC_SR_TGOOD)) 257 - printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT)); 255 + pr_crit("Overheat alarm (%d)\n", inb_p(WDT_RT)); 258 256 if (!(status & WDC_SR_PSUOVER)) 259 - printk(KERN_CRIT "PSU over voltage.\n"); 257 + pr_crit("PSU over voltage\n"); 260 258 if (!(status & WDC_SR_PSUUNDR)) 261 - printk(KERN_CRIT "PSU under voltage.\n"); 259 + pr_crit("PSU under voltage\n"); 262 260 } 263 261 264 262 /** ··· 282 280 spin_lock(&wdt_lock); 283 281 status = inb_p(WDT_SR); 284 282 285 - printk(KERN_CRIT "WDT status %d\n", status); 283 + pr_crit("WDT status %d\n", status); 286 284 287 285 if (type == 501) { 288 286 wdt_decode_501(status); 289 287 if (tachometer) { 290 288 if (!(status & WDC_SR_FANGOOD)) 291 - printk(KERN_CRIT "Possible fan fault.\n"); 289 + pr_crit("Possible fan fault\n"); 292 290 } 293 291 } 294 292 if (!(status & WDC_SR_WCCR)) { 295 293 #ifdef SOFTWARE_REBOOT 296 294 #ifdef ONLY_TESTING 297 - printk(KERN_CRIT "Would Reboot.\n"); 295 + pr_crit("Would Reboot\n"); 298 296 #else 299 - printk(KERN_CRIT "Initiating system reboot.\n"); 297 + pr_crit("Initiating system reboot\n"); 300 298 emergency_restart(); 301 299 #endif 302 300 #else 303 - printk(KERN_CRIT "Reset in 5ms.\n"); 301 + pr_crit("Reset in 5ms\n"); 304 302 #endif 305 303 } 306 304 spin_unlock(&wdt_lock); ··· 443 441 wdt_stop(); 444 442 clear_bit(0, &wdt_is_open); 445 443 } else { 446 - printk(KERN_CRIT 447 - "wdt: WDT device closed unexpectedly. WDT will not stop!\n"); 444 + pr_crit("WDT device closed unexpectedly. WDT will not stop!\n"); 448 445 wdt_ping(); 449 446 } 450 447 expect_close = 0; ··· 594 593 int ret; 595 594 596 595 if (type != 500 && type != 501) { 597 - printk(KERN_ERR "wdt: unknown card type '%d'.\n", type); 596 + pr_err("unknown card type '%d'\n", type); 598 597 return -ENODEV; 599 598 } 600 599 ··· 602 601 if not reset to the default */ 603 602 if (wdt_set_heartbeat(heartbeat)) { 604 603 wdt_set_heartbeat(WD_TIMO); 605 - printk(KERN_INFO "wdt: heartbeat value must be " 606 - "0 < heartbeat < 65536, using %d\n", WD_TIMO); 604 + pr_info("heartbeat value must be 0 < heartbeat < 65536, using %d\n", 605 + WD_TIMO); 607 606 } 608 607 609 608 if (!request_region(io, 8, "wdt501p")) { 610 - printk(KERN_ERR 611 - "wdt: I/O address 0x%04x already in use\n", io); 609 + pr_err("I/O address 0x%04x already in use\n", io); 612 610 ret = -EBUSY; 613 611 goto out; 614 612 } 615 613 616 614 ret = request_irq(irq, wdt_interrupt, 0, "wdt501p", NULL); 617 615 if (ret) { 618 - printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq); 616 + pr_err("IRQ %d is not free\n", irq); 619 617 goto outreg; 620 618 } 621 619 622 620 ret = register_reboot_notifier(&wdt_notifier); 623 621 if (ret) { 624 - printk(KERN_ERR 625 - "wdt: cannot register reboot notifier (err=%d)\n", ret); 622 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 626 623 goto outirq; 627 624 } 628 625 629 626 if (type == 501) { 630 627 ret = misc_register(&temp_miscdev); 631 628 if (ret) { 632 - printk(KERN_ERR "wdt: cannot register miscdev " 633 - "on minor=%d (err=%d)\n", TEMP_MINOR, ret); 629 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 630 + TEMP_MINOR, ret); 634 631 goto outrbt; 635 632 } 636 633 } 637 634 638 635 ret = misc_register(&wdt_miscdev); 639 636 if (ret) { 640 - printk(KERN_ERR 641 - "wdt: cannot register miscdev on minor=%d (err=%d)\n", 642 - WATCHDOG_MINOR, ret); 637 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 638 + WATCHDOG_MINOR, ret); 643 639 goto outmisc; 644 640 } 645 641 646 - printk(KERN_INFO "WDT500/501-P driver 0.10 " 647 - "at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", 642 + pr_info("WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n", 648 643 io, irq, heartbeat, nowayout); 649 644 if (type == 501) 650 - printk(KERN_INFO "wdt: Fan Tachometer is %s\n", 651 - (tachometer ? "Enabled" : "Disabled")); 645 + pr_info("Fan Tachometer is %s\n", 646 + tachometer ? "Enabled" : "Disabled"); 652 647 return 0; 653 648 654 649 outmisc:
+6 -6
drivers/watchdog/wdt285.c
··· 16 16 * 17 17 */ 18 18 19 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 20 + 19 21 #include <linux/module.h> 20 22 #include <linux/moduleparam.h> 21 23 #include <linux/types.h> ··· 51 49 */ 52 50 static void watchdog_fire(int irq, void *dev_id) 53 51 { 54 - printk(KERN_CRIT "Watchdog: Would Reboot.\n"); 52 + pr_crit("Would Reboot\n"); 55 53 *CSR_TIMER4_CNTL = 0; 56 54 *CSR_TIMER4_CLR = 0; 57 55 } ··· 207 205 if (retval < 0) 208 206 return retval; 209 207 210 - printk(KERN_INFO 211 - "Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n", 212 - soft_margin); 208 + pr_info("Footbridge Watchdog Timer: 0.01, timer margin: %d sec\n", 209 + soft_margin); 213 210 214 211 if (machine_is_cats()) 215 - printk(KERN_WARNING 216 - "Warning: Watchdog reset may not work on this machine.\n"); 212 + pr_warn("Warning: Watchdog reset may not work on this machine\n"); 217 213 return 0; 218 214 } 219 215
+15 -21
drivers/watchdog/wdt977.c
··· 23 23 * Netwinders only 24 24 */ 25 25 26 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 27 + 26 28 #include <linux/module.h> 27 29 #include <linux/moduleparam.h> 28 30 #include <linux/types.h> ··· 44 42 45 43 #define WATCHDOG_VERSION "0.04" 46 44 #define WATCHDOG_NAME "Wdt977" 47 - #define PFX WATCHDOG_NAME ": " 48 - #define DRIVER_VERSION WATCHDOG_NAME " driver, v" WATCHDOG_VERSION "\n" 49 45 50 46 #define IO_INDEX_PORT 0x370 /* on some systems it can be 0x3F0 */ 51 47 #define IO_DATA_PORT (IO_INDEX_PORT + 1) ··· 119 119 outb_p(LOCK_DATA, IO_INDEX_PORT); 120 120 121 121 spin_unlock_irqrestore(&spinlock, flags); 122 - printk(KERN_INFO PFX "activated.\n"); 122 + pr_info("activated\n"); 123 123 124 124 return 0; 125 125 } ··· 164 164 outb_p(LOCK_DATA, IO_INDEX_PORT); 165 165 166 166 spin_unlock_irqrestore(&spinlock, flags); 167 - printk(KERN_INFO PFX "shutdown.\n"); 167 + pr_info("shutdown\n"); 168 168 169 169 return 0; 170 170 } ··· 288 288 clear_bit(0, &timer_alive); 289 289 } else { 290 290 wdt977_keepalive(); 291 - printk(KERN_CRIT PFX 292 - "Unexpected close, not stopping watchdog!\n"); 291 + pr_crit("Unexpected close, not stopping watchdog!\n"); 293 292 } 294 293 expect_close = 0; 295 294 return 0; ··· 445 446 { 446 447 int rc; 447 448 448 - printk(KERN_INFO PFX DRIVER_VERSION); 449 + pr_info("driver v%s\n", WATCHDOG_VERSION); 449 450 450 451 /* Check that the timeout value is within its range; 451 452 if not reset to the default */ 452 453 if (wdt977_set_timeout(timeout)) { 453 454 wdt977_set_timeout(DEFAULT_TIMEOUT); 454 - printk(KERN_INFO PFX 455 - "timeout value must be 60 < timeout < 15300, using %d\n", 456 - DEFAULT_TIMEOUT); 455 + pr_info("timeout value must be 60 < timeout < 15300, using %d\n", 456 + DEFAULT_TIMEOUT); 457 457 } 458 458 459 459 /* on Netwinder the IOports are already reserved by ··· 460 462 */ 461 463 if (!machine_is_netwinder()) { 462 464 if (!request_region(IO_INDEX_PORT, 2, WATCHDOG_NAME)) { 463 - printk(KERN_ERR PFX 464 - "I/O address 0x%04x already in use\n", 465 - IO_INDEX_PORT); 465 + pr_err("I/O address 0x%04x already in use\n", 466 + IO_INDEX_PORT); 466 467 rc = -EIO; 467 468 goto err_out; 468 469 } ··· 469 472 470 473 rc = register_reboot_notifier(&wdt977_notifier); 471 474 if (rc) { 472 - printk(KERN_ERR PFX 473 - "cannot register reboot notifier (err=%d)\n", rc); 475 + pr_err("cannot register reboot notifier (err=%d)\n", rc); 474 476 goto err_out_region; 475 477 } 476 478 477 479 rc = misc_register(&wdt977_miscdev); 478 480 if (rc) { 479 - printk(KERN_ERR PFX 480 - "cannot register miscdev on minor=%d (err=%d)\n", 481 - wdt977_miscdev.minor, rc); 481 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 482 + wdt977_miscdev.minor, rc); 482 483 goto err_out_reboot; 483 484 } 484 485 485 - printk(KERN_INFO PFX 486 - "initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n", 487 - timeout, nowayout, testmode); 486 + pr_info("initialized. timeout=%d sec (nowayout=%d, testmode=%i)\n", 487 + timeout, nowayout, testmode); 488 488 489 489 return 0; 490 490
+30 -36
drivers/watchdog/wdt_pci.c
··· 37 37 * Matt Domsch : nowayout module option 38 38 */ 39 39 40 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 41 + 40 42 #include <linux/interrupt.h> 41 43 #include <linux/module.h> 42 44 #include <linux/moduleparam.h> ··· 59 57 60 58 #define WDT_IS_PCI 61 59 #include "wd501p.h" 62 - 63 - #define PFX "wdt_pci: " 64 60 65 61 /* We can only use 1 card due to the /dev/watchdog restriction */ 66 62 static int dev_count; ··· 312 312 status = inb(WDT_SR); 313 313 udelay(8); 314 314 315 - printk(KERN_CRIT PFX "status %d\n", status); 315 + pr_crit("status %d\n", status); 316 316 317 317 if (type == 501) { 318 318 if (!(status & WDC_SR_TGOOD)) { 319 - printk(KERN_CRIT PFX "Overheat alarm.(%d)\n", 320 - inb(WDT_RT)); 319 + pr_crit("Overheat alarm (%d)\n", inb(WDT_RT)); 321 320 udelay(8); 322 321 } 323 322 if (!(status & WDC_SR_PSUOVER)) 324 - printk(KERN_CRIT PFX "PSU over voltage.\n"); 323 + pr_crit("PSU over voltage\n"); 325 324 if (!(status & WDC_SR_PSUUNDR)) 326 - printk(KERN_CRIT PFX "PSU under voltage.\n"); 325 + pr_crit("PSU under voltage\n"); 327 326 if (tachometer) { 328 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 331 if (!(status & WDC_SR_WCCR)) { 333 332 #ifdef SOFTWARE_REBOOT 334 333 #ifdef ONLY_TESTING 335 - printk(KERN_CRIT PFX "Would Reboot.\n"); 334 + pr_crit("Would Reboot\n"); 336 335 #else 337 - printk(KERN_CRIT PFX "Initiating system reboot.\n"); 336 + pr_crit("Initiating system reboot\n"); 338 337 emergency_restart(NULL); 339 338 #endif 340 339 #else 341 - printk(KERN_CRIT PFX "Reset in 5ms.\n"); 340 + pr_crit("Reset in 5ms\n"); 342 341 #endif 343 342 } 344 343 spin_unlock(&wdtpci_lock); ··· 483 484 if (expect_close == 42) { 484 485 wdtpci_stop(); 485 486 } else { 486 - printk(KERN_CRIT PFX "Unexpected close, not stopping timer!"); 487 + pr_crit("Unexpected close, not stopping timer!\n"); 487 488 wdtpci_ping(); 488 489 } 489 490 expect_close = 0; ··· 613 614 614 615 dev_count++; 615 616 if (dev_count > 1) { 616 - printk(KERN_ERR PFX "This driver only supports one device\n"); 617 + pr_err("This driver only supports one device\n"); 617 618 return -ENODEV; 618 619 } 619 620 620 621 if (type != 500 && type != 501) { 621 - printk(KERN_ERR PFX "unknown card type '%d'.\n", type); 622 + pr_err("unknown card type '%d'\n", type); 622 623 return -ENODEV; 623 624 } 624 625 625 626 if (pci_enable_device(dev)) { 626 - printk(KERN_ERR PFX "Not possible to enable PCI Device\n"); 627 + pr_err("Not possible to enable PCI Device\n"); 627 628 return -ENODEV; 628 629 } 629 630 630 631 if (pci_resource_start(dev, 2) == 0x0000) { 631 - printk(KERN_ERR PFX "No I/O-Address for card detected\n"); 632 + pr_err("No I/O-Address for card detected\n"); 632 633 ret = -ENODEV; 633 634 goto out_pci; 634 635 } 635 636 636 637 if (pci_request_region(dev, 2, "wdt_pci")) { 637 - printk(KERN_ERR PFX "I/O address 0x%llx already in use\n", 638 - (unsigned long long)pci_resource_start(dev, 2)); 638 + pr_err("I/O address 0x%llx already in use\n", 639 + (unsigned long long)pci_resource_start(dev, 2)); 639 640 goto out_pci; 640 641 } 641 642 ··· 644 645 645 646 if (request_irq(irq, wdtpci_interrupt, IRQF_SHARED, 646 647 "wdt_pci", &wdtpci_miscdev)) { 647 - printk(KERN_ERR PFX "IRQ %d is not free\n", irq); 648 + pr_err("IRQ %d is not free\n", irq); 648 649 goto out_reg; 649 650 } 650 651 651 - printk(KERN_INFO 652 - "PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%llx (Interrupt %d)\n", 653 - (unsigned long long)io, irq); 652 + pr_info("PCI-WDT500/501 (PCI-WDG-CSM) driver 0.10 at 0x%llx (Interrupt %d)\n", 653 + (unsigned long long)io, irq); 654 654 655 655 /* Check that the heartbeat value is within its range; 656 656 if not reset to the default */ 657 657 if (wdtpci_set_heartbeat(heartbeat)) { 658 658 wdtpci_set_heartbeat(WD_TIMO); 659 - printk(KERN_INFO PFX 660 - "heartbeat value must be 0 < heartbeat < 65536, using %d\n", 661 - WD_TIMO); 659 + pr_info("heartbeat value must be 0 < heartbeat < 65536, using %d\n", 660 + WD_TIMO); 662 661 } 663 662 664 663 ret = register_reboot_notifier(&wdtpci_notifier); 665 664 if (ret) { 666 - printk(KERN_ERR PFX 667 - "cannot register reboot notifier (err=%d)\n", ret); 665 + pr_err("cannot register reboot notifier (err=%d)\n", ret); 668 666 goto out_irq; 669 667 } 670 668 671 669 if (type == 501) { 672 670 ret = misc_register(&temp_miscdev); 673 671 if (ret) { 674 - printk(KERN_ERR PFX 675 - "cannot register miscdev on minor=%d (err=%d)\n", 676 - TEMP_MINOR, ret); 672 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 673 + TEMP_MINOR, ret); 677 674 goto out_rbt; 678 675 } 679 676 } 680 677 681 678 ret = misc_register(&wdtpci_miscdev); 682 679 if (ret) { 683 - printk(KERN_ERR PFX 684 - "cannot register miscdev on minor=%d (err=%d)\n", 685 - WATCHDOG_MINOR, ret); 680 + pr_err("cannot register miscdev on minor=%d (err=%d)\n", 681 + WATCHDOG_MINOR, ret); 686 682 goto out_misc; 687 683 } 688 684 689 - printk(KERN_INFO PFX "initialized. heartbeat=%d sec (nowayout=%d)\n", 685 + pr_info("initialized. heartbeat=%d sec (nowayout=%d)\n", 690 686 heartbeat, nowayout); 691 687 if (type == 501) 692 - printk(KERN_INFO "wdt: Fan Tachometer is %s\n", 693 - (tachometer ? "Enabled" : "Disabled")); 688 + pr_info("Fan Tachometer is %s\n", 689 + tachometer ? "Enabled" : "Disabled"); 694 690 695 691 ret = 0; 696 692 out:
+2
drivers/watchdog/wm8350_wdt.c
··· 8 8 * as published by the Free Software Foundation 9 9 */ 10 10 11 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 12 + 11 13 #include <linux/module.h> 12 14 #include <linux/moduleparam.h> 13 15 #include <linux/types.h>
+11 -14
drivers/watchdog/xen_wdt.c
··· 9 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 14 #define DRV_NAME "wdt" 13 15 #define DRV_VERSION "0.01" 14 - #define PFX DRV_NAME ": " 15 16 16 17 #include <linux/bug.h> 17 18 #include <linux/errno.h> ··· 135 134 if (expect_release) 136 135 xen_wdt_stop(); 137 136 else { 138 - printk(KERN_CRIT PFX 139 - "unexpected close, not stopping watchdog!\n"); 137 + pr_crit("unexpected close, not stopping watchdog!\n"); 140 138 xen_wdt_kick(); 141 139 } 142 140 is_active = false; ··· 251 251 case -EINVAL: 252 252 if (!timeout) { 253 253 timeout = WATCHDOG_TIMEOUT; 254 - printk(KERN_INFO PFX 255 - "timeout value invalid, using %d\n", timeout); 254 + pr_info("timeout value invalid, using %d\n", timeout); 256 255 } 257 256 258 257 ret = misc_register(&xen_wdt_miscdev); 259 258 if (ret) { 260 - printk(KERN_ERR PFX 261 - "cannot register miscdev on minor=%d (%d)\n", 259 + pr_err("cannot register miscdev on minor=%d (%d)\n", 262 260 WATCHDOG_MINOR, ret); 263 261 break; 264 262 } 265 263 266 - printk(KERN_INFO PFX 267 - "initialized (timeout=%ds, nowayout=%d)\n", 268 - timeout, nowayout); 264 + pr_info("initialized (timeout=%ds, nowayout=%d)\n", 265 + timeout, nowayout); 269 266 break; 270 267 271 268 case -ENOSYS: 272 - printk(KERN_INFO PFX "not supported\n"); 269 + pr_info("not supported\n"); 273 270 ret = -ENODEV; 274 271 break; 275 272 276 273 default: 277 - printk(KERN_INFO PFX "bogus return value %d\n", ret); 274 + pr_info("bogus return value %d\n", ret); 278 275 break; 279 276 } 280 277 ··· 323 326 if (!xen_domain()) 324 327 return -ENODEV; 325 328 326 - printk(KERN_INFO PFX "Xen WatchDog Timer Driver v%s\n", DRV_VERSION); 329 + pr_info("Xen WatchDog Timer Driver v%s\n", DRV_VERSION); 327 330 328 331 err = platform_driver_register(&xen_wdt_driver); 329 332 if (err) ··· 343 346 { 344 347 platform_device_unregister(platform_device); 345 348 platform_driver_unregister(&xen_wdt_driver); 346 - printk(KERN_INFO PFX "module unloaded\n"); 349 + pr_info("module unloaded\n"); 347 350 } 348 351 349 352 module_init(xen_wdt_init_module);