diff options
| author | Tim Gardner <tim.gardner@canonical.com> | 2013-09-19 17:24:04 -0400 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2013-10-06 04:23:41 -0400 |
| commit | 0a6ad06c43315ce0e5115d5ce51b04464245dde8 (patch) | |
| tree | 53947b42185e89bd975e9d123ae53f4df688b064 /drivers/input/misc | |
| parent | a60a71b035e4d2f4920ef091265b1474a14ab313 (diff) | |
Input: cm109 - convert high volume dev_err() to dev_err_ratelimited()
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 <tim.gardner@canonical.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/misc')
| -rw-r--r-- | drivers/input/misc/cm109.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index 082684e7f390..9365535ba7f1 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c | |||
| @@ -351,7 +351,9 @@ static void cm109_urb_irq_callback(struct urb *urb) | |||
| 351 | if (status) { | 351 | if (status) { |
| 352 | if (status == -ESHUTDOWN) | 352 | if (status == -ESHUTDOWN) |
| 353 | return; | 353 | return; |
| 354 | dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status); | 354 | dev_err_ratelimited(&dev->intf->dev, "%s: urb status %d\n", |
| 355 | __func__, status); | ||
| 356 | goto out; | ||
| 355 | } | 357 | } |
| 356 | 358 | ||
| 357 | /* Special keys */ | 359 | /* Special keys */ |
| @@ -418,8 +420,12 @@ static void cm109_urb_ctl_callback(struct urb *urb) | |||
| 418 | dev->ctl_data->byte[2], | 420 | dev->ctl_data->byte[2], |
| 419 | dev->ctl_data->byte[3]); | 421 | dev->ctl_data->byte[3]); |
| 420 | 422 | ||
| 421 | if (status) | 423 | if (status) { |
| 422 | dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status); | 424 | if (status == -ESHUTDOWN) |
| 425 | return; | ||
| 426 | dev_err_ratelimited(&dev->intf->dev, "%s: urb status %d\n", | ||
| 427 | __func__, status); | ||
| 428 | } | ||
| 423 | 429 | ||
| 424 | spin_lock(&dev->ctl_submit_lock); | 430 | spin_lock(&dev->ctl_submit_lock); |
| 425 | 431 | ||
| @@ -427,7 +433,7 @@ static void cm109_urb_ctl_callback(struct urb *urb) | |||
| 427 | 433 | ||
| 428 | if (likely(!dev->shutdown)) { | 434 | if (likely(!dev->shutdown)) { |
| 429 | 435 | ||
| 430 | if (dev->buzzer_pending) { | 436 | if (dev->buzzer_pending || status) { |
| 431 | dev->buzzer_pending = 0; | 437 | dev->buzzer_pending = 0; |
| 432 | dev->ctl_urb_pending = 1; | 438 | dev->ctl_urb_pending = 1; |
| 433 | cm109_submit_buzz_toggle(dev); | 439 | cm109_submit_buzz_toggle(dev); |
