asoc: codecs: Replace dev_err/info with ratelimit prints
replace all dev(pr)_err/info logs that could potentially flood kernel logs with ratelimit functions dev_err_ratelimited and dev_info_ratelimited Change-Id: I32dc6002dead1a07622978c4de63d541c01982fd Signed-off-by: Shazmaan Ali <quic_shazmaan@quicinc.com>
This commit is contained in:
@@ -119,12 +119,12 @@ static int msm_cdc_check_supply_param(struct device *dev,
|
||||
int num_supplies)
|
||||
{
|
||||
if (!dev) {
|
||||
pr_err("%s: device is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: device is NULL\n", __func__);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!cdc_vreg || (num_supplies <= 0)) {
|
||||
dev_err(dev, "%s: supply check failed: vreg: %pK, num_supplies: %d\n",
|
||||
dev_err_ratelimited(dev, "%s: supply check failed: vreg: %pK, num_supplies: %d\n",
|
||||
__func__, cdc_vreg, num_supplies);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -154,7 +154,7 @@ bool msm_cdc_is_ondemand_supply(struct device *dev,
|
||||
int ret, i;
|
||||
|
||||
if ((!supply_name) || (!supplies)) {
|
||||
pr_err("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
pr_err_ratelimited("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
__func__);
|
||||
return rc;
|
||||
}
|
||||
@@ -195,7 +195,7 @@ int msm_cdc_set_supply_min_voltage(struct device *dev,
|
||||
int rc = 0, i;
|
||||
|
||||
if ((!supply_name) || (!supplies)) {
|
||||
pr_err("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
pr_err_ratelimited("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -240,7 +240,7 @@ int msm_cdc_disable_ondemand_supply(struct device *dev,
|
||||
int rc, i;
|
||||
|
||||
if ((!supply_name) || (!supplies)) {
|
||||
pr_err("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
pr_err_ratelimited("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -254,13 +254,14 @@ int msm_cdc_disable_ondemand_supply(struct device *dev,
|
||||
!strcmp(cdc_vreg[i].name, supply_name)) {
|
||||
rc = regulator_disable(supplies[i].consumer);
|
||||
if (rc)
|
||||
dev_err(dev, "%s: failed to disable supply %s, err:%d\n",
|
||||
dev_err_ratelimited(dev,
|
||||
"%s: failed to disable supply %s, err:%d\n",
|
||||
__func__, supplies[i].supply, rc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == num_supplies) {
|
||||
dev_err(dev, "%s: not able to find supply %s\n",
|
||||
dev_err_ratelimited(dev, "%s: not able to find supply %s\n",
|
||||
__func__, supply_name);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
@@ -290,7 +291,7 @@ int msm_cdc_enable_ondemand_supply(struct device *dev,
|
||||
int rc, i;
|
||||
|
||||
if ((!supply_name) || (!supplies)) {
|
||||
pr_err("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
pr_err_ratelimited("%s: either dev or supplies or cdc_vreg is NULL\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -304,13 +305,13 @@ int msm_cdc_enable_ondemand_supply(struct device *dev,
|
||||
!strcmp(cdc_vreg[i].name, supply_name)) {
|
||||
rc = regulator_enable(supplies[i].consumer);
|
||||
if (rc)
|
||||
dev_err(dev, "%s: failed to enable supply %s, rc: %d\n",
|
||||
dev_err_ratelimited(dev, "%s: failed to enable supply %s, rc: %d\n",
|
||||
__func__, supplies[i].supply, rc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == num_supplies) {
|
||||
dev_err(dev, "%s: not able to find supply %s\n",
|
||||
dev_err_ratelimited(dev, "%s: not able to find supply %s\n",
|
||||
__func__, supply_name);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
@@ -341,7 +342,7 @@ int msm_cdc_set_supplies_lpm_mode(struct device *dev,
|
||||
int rc = 0, i;
|
||||
|
||||
if (!supplies) {
|
||||
pr_err("%s: supplies is NULL\n",
|
||||
pr_err_ratelimited("%s: supplies is NULL\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -356,7 +357,7 @@ int msm_cdc_set_supplies_lpm_mode(struct device *dev,
|
||||
supplies[i].consumer,
|
||||
flag ? 0 : cdc_vreg[i].optimum_uA);
|
||||
if (rc)
|
||||
dev_err(dev,
|
||||
dev_err_ratelimited(dev,
|
||||
"%s: failed to set supply %s to %s, err:%d\n",
|
||||
__func__, supplies[i].supply,
|
||||
flag ? "LPM" : "NOM",
|
||||
@@ -646,13 +647,13 @@ int msm_cdc_get_power_supplies(struct device *dev,
|
||||
int rc;
|
||||
|
||||
if (!dev) {
|
||||
pr_err("%s: device pointer is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: device pointer is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
static_sup_cnt = of_property_count_strings(dev->of_node,
|
||||
static_prop_name);
|
||||
if (static_sup_cnt < 0) {
|
||||
dev_err(dev, "%s: Failed to get static supplies(%d)\n",
|
||||
dev_err_ratelimited(dev, "%s: Failed to get static supplies(%d)\n",
|
||||
__func__, static_sup_cnt);
|
||||
rc = static_sup_cnt;
|
||||
goto err_supply_cnt;
|
||||
@@ -668,7 +669,7 @@ int msm_cdc_get_power_supplies(struct device *dev,
|
||||
|
||||
num_supplies = static_sup_cnt + ond_sup_cnt + cp_sup_cnt;
|
||||
if (num_supplies <= 0) {
|
||||
dev_err(dev, "%s: supply count is 0 or negative\n", __func__);
|
||||
dev_err_ratelimited(dev, "%s: supply count is 0 or negative\n", __func__);
|
||||
rc = -EINVAL;
|
||||
goto err_supply_cnt;
|
||||
}
|
||||
@@ -684,7 +685,7 @@ int msm_cdc_get_power_supplies(struct device *dev,
|
||||
rc = msm_cdc_parse_supplies(dev, cdc_reg, static_prop_name,
|
||||
static_sup_cnt, false);
|
||||
if (rc) {
|
||||
dev_err(dev, "%s: failed to parse static supplies(%d)\n",
|
||||
dev_err_ratelimited(dev, "%s: failed to parse static supplies(%d)\n",
|
||||
__func__, rc);
|
||||
goto err_sup;
|
||||
}
|
||||
@@ -693,7 +694,7 @@ int msm_cdc_get_power_supplies(struct device *dev,
|
||||
ond_prop_name, ond_sup_cnt,
|
||||
true);
|
||||
if (rc) {
|
||||
dev_err(dev, "%s: failed to parse demand supplies(%d)\n",
|
||||
dev_err_ratelimited(dev, "%s: failed to parse demand supplies(%d)\n",
|
||||
__func__, rc);
|
||||
goto err_sup;
|
||||
}
|
||||
@@ -702,7 +703,7 @@ int msm_cdc_get_power_supplies(struct device *dev,
|
||||
&cdc_reg[static_sup_cnt + ond_sup_cnt],
|
||||
cp_prop_name, cp_sup_cnt, true);
|
||||
if (rc) {
|
||||
dev_err(dev, "%s: failed to parse cp supplies(%d)\n",
|
||||
dev_err_ratelimited(dev, "%s: failed to parse cp supplies(%d)\n",
|
||||
__func__, rc);
|
||||
goto err_sup;
|
||||
}
|
||||
@@ -764,7 +765,7 @@ int msm_cdc_enable_wcd_supply(struct cdc_wcd_supply *cdc_supply, bool enable)
|
||||
int rc;
|
||||
|
||||
if (!component) {
|
||||
pr_err("%s: Component memory is NULL\n", __func__);
|
||||
pr_err_ratelimited("%s: Component memory is NULL\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -780,7 +781,7 @@ int msm_cdc_enable_wcd_supply(struct cdc_wcd_supply *cdc_supply, bool enable)
|
||||
if (!rc)
|
||||
snd_soc_dapm_sync(snd_soc_component_get_dapm(component));
|
||||
else
|
||||
dev_err(component->dev, "%s: micbias %s force %s pin failed\n",
|
||||
dev_err_ratelimited(component->dev, "%s: micbias %s force %s pin failed\n",
|
||||
__func__, cdc_supply->name, (enable ? "enable" : "disable"));
|
||||
|
||||
return rc;
|
||||
|
Reference in New Issue
Block a user