Commit 81fc401e authored by Michael Buesch's avatar Michael Buesch Committed by Linus Torvalds

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: default avatarMichael Buesch <mb@bu3sch.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9653a69e
...@@ -114,8 +114,7 @@ static ssize_t pp_read (struct file * file, char __user * buf, size_t count, ...@@ -114,8 +114,7 @@ static ssize_t pp_read (struct file * file, char __user * buf, size_t count,
if (!(pp->flags & PP_CLAIMED)) { if (!(pp->flags & PP_CLAIMED)) {
/* Don't have the port claimed */ /* Don't have the port claimed */
printk (KERN_DEBUG CHRDEV "%x: claim the port first\n", pr_debug(CHRDEV "%x: claim the port first\n", minor);
minor);
return -EINVAL; return -EINVAL;
} }
...@@ -198,8 +197,7 @@ static ssize_t pp_write (struct file * file, const char __user * buf, ...@@ -198,8 +197,7 @@ static ssize_t pp_write (struct file * file, const char __user * buf,
if (!(pp->flags & PP_CLAIMED)) { if (!(pp->flags & PP_CLAIMED)) {
/* Don't have the port claimed */ /* Don't have the port claimed */
printk (KERN_DEBUG CHRDEV "%x: claim the port first\n", pr_debug(CHRDEV "%x: claim the port first\n", minor);
minor);
return -EINVAL; return -EINVAL;
} }
...@@ -313,7 +311,7 @@ static int register_device (int minor, struct pp_struct *pp) ...@@ -313,7 +311,7 @@ static int register_device (int minor, struct pp_struct *pp)
} }
pp->pdev = pdev; pp->pdev = pdev;
printk (KERN_DEBUG "%s: registered pardevice\n", name); pr_debug("%s: registered pardevice\n", name);
return 0; return 0;
} }
...@@ -343,8 +341,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -343,8 +341,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
int ret; int ret;
if (pp->flags & PP_CLAIMED) { if (pp->flags & PP_CLAIMED) {
printk (KERN_DEBUG CHRDEV pr_debug(CHRDEV "%x: you've already got it!\n", minor);
"%x: you've already got it!\n", minor);
return -EINVAL; return -EINVAL;
} }
...@@ -379,7 +376,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -379,7 +376,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
} }
case PPEXCL: case PPEXCL:
if (pp->pdev) { if (pp->pdev) {
printk (KERN_DEBUG CHRDEV "%x: too late for PPEXCL; " pr_debug(CHRDEV "%x: too late for PPEXCL; "
"already registered\n", minor); "already registered\n", minor);
if (pp->flags & PP_EXCL) if (pp->flags & PP_EXCL)
/* But it's not really an error. */ /* But it's not really an error. */
...@@ -491,8 +488,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -491,8 +488,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
/* Everything else requires the port to be claimed, so check /* Everything else requires the port to be claimed, so check
* that now. */ * that now. */
if ((pp->flags & PP_CLAIMED) == 0) { if ((pp->flags & PP_CLAIMED) == 0) {
printk (KERN_DEBUG CHRDEV "%x: claim the port first\n", pr_debug(CHRDEV "%x: claim the port first\n", minor);
minor);
return -EINVAL; return -EINVAL;
} }
...@@ -624,8 +620,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -624,8 +620,7 @@ static int pp_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return 0; return 0;
default: default:
printk (KERN_DEBUG CHRDEV "%x: What? (cmd=0x%x)\n", minor, pr_debug(CHRDEV "%x: What? (cmd=0x%x)\n", minor, cmd);
cmd);
return -EINVAL; return -EINVAL;
} }
...@@ -698,9 +693,8 @@ static int pp_release (struct inode * inode, struct file * file) ...@@ -698,9 +693,8 @@ static int pp_release (struct inode * inode, struct file * file)
} }
if (compat_negot) { if (compat_negot) {
parport_negotiate (pp->pdev->port, IEEE1284_MODE_COMPAT); parport_negotiate (pp->pdev->port, IEEE1284_MODE_COMPAT);
printk (KERN_DEBUG CHRDEV pr_debug(CHRDEV "%x: negotiated back to compatibility "
"%x: negotiated back to compatibility mode because " "mode because user-space forgot\n", minor);
"user-space forgot\n", minor);
} }
if (pp->flags & PP_CLAIMED) { if (pp->flags & PP_CLAIMED) {
...@@ -713,7 +707,7 @@ static int pp_release (struct inode * inode, struct file * file) ...@@ -713,7 +707,7 @@ static int pp_release (struct inode * inode, struct file * file)
info->phase = pp->saved_state.phase; info->phase = pp->saved_state.phase;
parport_release (pp->pdev); parport_release (pp->pdev);
if (compat_negot != 1) { if (compat_negot != 1) {
printk (KERN_DEBUG CHRDEV "%x: released pardevice " pr_debug(CHRDEV "%x: released pardevice "
"because user-space forgot\n", minor); "because user-space forgot\n", minor);
} }
} }
...@@ -723,8 +717,7 @@ static int pp_release (struct inode * inode, struct file * file) ...@@ -723,8 +717,7 @@ static int pp_release (struct inode * inode, struct file * file)
parport_unregister_device (pp->pdev); parport_unregister_device (pp->pdev);
kfree (name); kfree (name);
pp->pdev = NULL; pp->pdev = NULL;
printk (KERN_DEBUG CHRDEV "%x: unregistered pardevice\n", pr_debug(CHRDEV "%x: unregistered pardevice\n", minor);
minor);
} }
kfree (pp); kfree (pp);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment