{
int report, button_status;
- dev_warn(module->dev, "Jack Event received: type: %u, event: %u\n",
- req->jack_attribute, req->event);
+ dev_warn_ratelimited(module->dev,
+ "Jack Event received: type: %u, event: %u\n",
+ req->jack_attribute, req->event);
if (req->event == GB_AUDIO_JACK_EVENT_REMOVAL) {
module->jack_type = 0;
report &= ~GBCODEC_JACK_MASK;
report |= req->jack_attribute & GBCODEC_JACK_MASK;
if (module->jack_type)
- dev_warn(module->dev, "Modifying jack from %d to %d\n",
- module->jack_type, report);
+ dev_warn_ratelimited(module->dev,
+ "Modifying jack from %d to %d\n",
+ module->jack_type, report);
module->jack_type = report;
snd_soc_jack_report(&module->headset_jack, report, GBCODEC_JACK_MASK);
{
int soc_button_id, report;
- dev_warn(module->dev, "Button Event received: id: %u, event: %u\n",
- req->button_id, req->event);
+ dev_warn_ratelimited(module->dev,
+ "Button Event received: id: %u, event: %u\n",
+ req->button_id, req->event);
/* currently supports 4 buttons only */
if (!module->jack_type) {
- dev_err(module->dev, "Jack not present. Bogus event!!\n");
+ dev_err_ratelimited(module->dev,
+ "Jack not present. Bogus event!!\n");
return -EINVAL;
}
soc_button_id = SND_JACK_BTN_3;
break;
default:
- dev_err(module->dev, "Invalid button request received\n");
+ dev_err_ratelimited(module->dev,
+ "Invalid button request received\n");
return -EINVAL;
}
break;
default:
- dev_err(&connection->bundle->dev,
- "Invalid Audio Event received\n");
+ dev_err_ratelimited(&connection->bundle->dev,
+ "Invalid Audio Event received\n");
return -EINVAL;
}
ret = gb_audio_gb_get_control(module->mgmt_connection, data->ctl_id,
GB_AUDIO_INVALID_INDEX, &gbvalue);
if (ret) {
- dev_err(codec->dev, "%d:Error in %s for %s\n", ret, __func__,
- kcontrol->id.name);
+ dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret,
+ __func__, kcontrol->id.name);
return ret;
}
ret = gb_audio_gb_set_control(module->mgmt_connection, data->ctl_id,
GB_AUDIO_INVALID_INDEX, &gbvalue);
if (ret) {
- dev_err(codec->dev, "%d:Error in %s for %s\n", ret, __func__,
- kcontrol->id.name);
+ dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret,
+ __func__, kcontrol->id.name);
}
return ret;
ret = gb_audio_gb_get_control(module->mgmt_connection, data->ctl_id,
GB_AUDIO_INVALID_INDEX, &gbvalue);
if (ret) {
- dev_err(codec->dev, "%d:Error in %s for %s\n", ret, __func__,
- kcontrol->id.name);
+ dev_err_ratelimited(codec->dev, "%d:Error in %s for %s\n", ret,
+ __func__, kcontrol->id.name);
return ret;
}
/* update ucontrol */
data->ctl_id,
GB_AUDIO_INVALID_INDEX, &gbvalue);
if (ret) {
- dev_err(codec->dev,
- "%d:Error in %s for %s\n", ret, __func__,
- kcontrol->id.name);
+ dev_err_ratelimited(codec->dev,
+ "%d:Error in %s for %s\n", ret,
+ __func__, kcontrol->id.name);
}
}
break;
}
if (ret)
- dev_err(codec->dev, "%d: widget, event:%d failed:%d\n", wid,
- event, ret);
+ dev_err_ratelimited(codec->dev,
+ "%d: widget, event:%d failed:%d\n", wid,
+ event, ret);
return ret;
}