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

ppdev: reduce kernel log spam

One of my programs frequently grabs the parport, does something with it
and then drops it again. This results in spamming of the kernel log with

"... registered pardevice"
"... unregistered pardevice"

These messages are completely useless, except for debugging ppdev,
probably. So put them under DEBUG (or dynamic debug).

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Michael Buesch and committed by
Linus Torvalds
81fc401e 9653a69e

+11 -18
+11 -18
drivers/char/ppdev.c
··· 114 114 115 115 if (!(pp->flags & PP_CLAIMED)) { 116 116 /* Don't have the port claimed */ 117 - printk (KERN_DEBUG CHRDEV "%x: claim the port first\n", 118 - minor); 117 + pr_debug(CHRDEV "%x: claim the port first\n", minor); 119 118 return -EINVAL; 120 119 } 121 120 ··· 197 198 198 199 if (!(pp->flags & PP_CLAIMED)) { 199 200 /* Don't have the port claimed */ 200 - printk (KERN_DEBUG CHRDEV "%x: claim the port first\n", 201 - minor); 201 + pr_debug(CHRDEV "%x: claim the port first\n", minor); 202 202 return -EINVAL; 203 203 } 204 204 ··· 311 313 } 312 314 313 315 pp->pdev = pdev; 314 - printk (KERN_DEBUG "%s: registered pardevice\n", name); 316 + pr_debug("%s: registered pardevice\n", name); 315 317 return 0; 316 318 } 317 319 ··· 341 343 int ret; 342 344 343 345 if (pp->flags & PP_CLAIMED) { 344 - printk (KERN_DEBUG CHRDEV 345 - "%x: you've already got it!\n", minor); 346 + pr_debug(CHRDEV "%x: you've already got it!\n", minor); 346 347 return -EINVAL; 347 348 } 348 349 ··· 376 379 } 377 380 case PPEXCL: 378 381 if (pp->pdev) { 379 - printk (KERN_DEBUG CHRDEV "%x: too late for PPEXCL; " 382 + pr_debug(CHRDEV "%x: too late for PPEXCL; " 380 383 "already registered\n", minor); 381 384 if (pp->flags & PP_EXCL) 382 385 /* But it's not really an error. */ ··· 488 491 /* Everything else requires the port to be claimed, so check 489 492 * that now. */ 490 493 if ((pp->flags & PP_CLAIMED) == 0) { 491 - printk (KERN_DEBUG CHRDEV "%x: claim the port first\n", 492 - minor); 494 + pr_debug(CHRDEV "%x: claim the port first\n", minor); 493 495 return -EINVAL; 494 496 } 495 497 ··· 620 624 return 0; 621 625 622 626 default: 623 - printk (KERN_DEBUG CHRDEV "%x: What? (cmd=0x%x)\n", minor, 624 - cmd); 627 + pr_debug(CHRDEV "%x: What? (cmd=0x%x)\n", minor, cmd); 625 628 return -EINVAL; 626 629 } 627 630 ··· 693 698 } 694 699 if (compat_negot) { 695 700 parport_negotiate (pp->pdev->port, IEEE1284_MODE_COMPAT); 696 - printk (KERN_DEBUG CHRDEV 697 - "%x: negotiated back to compatibility mode because " 698 - "user-space forgot\n", minor); 701 + pr_debug(CHRDEV "%x: negotiated back to compatibility " 702 + "mode because user-space forgot\n", minor); 699 703 } 700 704 701 705 if (pp->flags & PP_CLAIMED) { ··· 707 713 info->phase = pp->saved_state.phase; 708 714 parport_release (pp->pdev); 709 715 if (compat_negot != 1) { 710 - printk (KERN_DEBUG CHRDEV "%x: released pardevice " 716 + pr_debug(CHRDEV "%x: released pardevice " 711 717 "because user-space forgot\n", minor); 712 718 } 713 719 } ··· 717 723 parport_unregister_device (pp->pdev); 718 724 kfree (name); 719 725 pp->pdev = NULL; 720 - printk (KERN_DEBUG CHRDEV "%x: unregistered pardevice\n", 721 - minor); 726 + pr_debug(CHRDEV "%x: unregistered pardevice\n", minor); 722 727 } 723 728 724 729 kfree (pp);