Skip to content

Commit

Permalink
Input: cm109 - convert high volume dev_err() to dev_err_ratelimited()
Browse files Browse the repository at this point in the history
BugLink: http://bugs.launchpad.net/bugs/1222850

This input device can get into a state that produces a high
volume of device status errors. Attempt to throttle these
error messages such that the kernel log is not flooded.

Signed-off-by: Tim Gardner <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
rtg-canonical authored and dtor committed Oct 6, 2013
1 parent a60a71b commit 0a6ad06
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions drivers/input/misc/cm109.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,9 @@ static void cm109_urb_irq_callback(struct urb *urb)
if (status) {
if (status == -ESHUTDOWN)
return;
dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status);
dev_err_ratelimited(&dev->intf->dev, "%s: urb status %d\n",
__func__, status);
goto out;
}

/* Special keys */
Expand Down Expand Up @@ -418,16 +420,20 @@ static void cm109_urb_ctl_callback(struct urb *urb)
dev->ctl_data->byte[2],
dev->ctl_data->byte[3]);

if (status)
dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status);
if (status) {
if (status == -ESHUTDOWN)
return;
dev_err_ratelimited(&dev->intf->dev, "%s: urb status %d\n",
__func__, status);
}

spin_lock(&dev->ctl_submit_lock);

dev->ctl_urb_pending = 0;

if (likely(!dev->shutdown)) {

if (dev->buzzer_pending) {
if (dev->buzzer_pending || status) {
dev->buzzer_pending = 0;
dev->ctl_urb_pending = 1;
cm109_submit_buzz_toggle(dev);
Expand Down

0 comments on commit 0a6ad06

Please sign in to comment.