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>
This commit is contained in:
parent
a60a71b035
commit
0a6ad06c43
|
@ -351,7 +351,9 @@ static void cm109_urb_irq_callback(struct urb *urb)
|
||||||
if (status) {
|
if (status) {
|
||||||
if (status == -ESHUTDOWN)
|
if (status == -ESHUTDOWN)
|
||||||
return;
|
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 */
|
/* Special keys */
|
||||||
|
@ -418,8 +420,12 @@ static void cm109_urb_ctl_callback(struct urb *urb)
|
||||||
dev->ctl_data->byte[2],
|
dev->ctl_data->byte[2],
|
||||||
dev->ctl_data->byte[3]);
|
dev->ctl_data->byte[3]);
|
||||||
|
|
||||||
if (status)
|
if (status) {
|
||||||
dev_err(&dev->intf->dev, "%s: urb status %d\n", __func__, status);
|
if (status == -ESHUTDOWN)
|
||||||
|
return;
|
||||||
|
dev_err_ratelimited(&dev->intf->dev, "%s: urb status %d\n",
|
||||||
|
__func__, status);
|
||||||
|
}
|
||||||
|
|
||||||
spin_lock(&dev->ctl_submit_lock);
|
spin_lock(&dev->ctl_submit_lock);
|
||||||
|
|
||||||
|
@ -427,7 +433,7 @@ static void cm109_urb_ctl_callback(struct urb *urb)
|
||||||
|
|
||||||
if (likely(!dev->shutdown)) {
|
if (likely(!dev->shutdown)) {
|
||||||
|
|
||||||
if (dev->buzzer_pending) {
|
if (dev->buzzer_pending || status) {
|
||||||
dev->buzzer_pending = 0;
|
dev->buzzer_pending = 0;
|
||||||
dev->ctl_urb_pending = 1;
|
dev->ctl_urb_pending = 1;
|
||||||
cm109_submit_buzz_toggle(dev);
|
cm109_submit_buzz_toggle(dev);
|
||||||
|
|
Loading…
Reference in New Issue