aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorRandy Dunlap <rdunlap@xenotime.net>2005-07-31 23:41:19 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-08 19:22:40 -0400
commit0bc8e009a2d5106183ea31a2b83035e790778cab (patch)
tree88bba601400a656f63274b77246befceba0d704b /drivers/usb/class
parenta1cf96efbabac2f8af6f75286ffcefd40b0a466c (diff)
[PATCH] USB usblp: rate-limit printer status error messages
Rate-limit usblp printer error status messages. I unplugged my USB printer and almost instantly got several hundred of these in my kernel message log: drivers/usb/class/usblp.c: usblp0: error -19 reading printer status Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/usblp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
index 7ce43fb8118a..e195709c9c7f 100644
--- a/drivers/usb/class/usblp.c
+++ b/drivers/usb/class/usblp.c
@@ -310,8 +310,9 @@ static int usblp_check_status(struct usblp *usblp, int err)
310 310
311 error = usblp_read_status (usblp, usblp->statusbuf); 311 error = usblp_read_status (usblp, usblp->statusbuf);
312 if (error < 0) { 312 if (error < 0) {
313 err("usblp%d: error %d reading printer status", 313 if (printk_ratelimit())
314 usblp->minor, error); 314 err("usblp%d: error %d reading printer status",
315 usblp->minor, error);
315 return 0; 316 return 0;
316 } 317 }
317 318
@@ -604,7 +605,9 @@ static int usblp_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
604 605
605 case LPGETSTATUS: 606 case LPGETSTATUS:
606 if (usblp_read_status(usblp, usblp->statusbuf)) { 607 if (usblp_read_status(usblp, usblp->statusbuf)) {
607 err("usblp%d: failed reading printer status", usblp->minor); 608 if (printk_ratelimit())
609 err("usblp%d: failed reading printer status",
610 usblp->minor);
608 retval = -EIO; 611 retval = -EIO;
609 goto done; 612 goto done;
610 } 613 }