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>
这个提交包含在:
Shazmaan Ali
2022-03-22 11:26:47 -07:00
父节点 aa3950aed3
当前提交 a20e11e0c3
修改 27 个文件,包含 600 行新增569 行删除

查看文件

@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/module.h>
@@ -138,13 +139,13 @@ static int swr_dmic_tx_master_port_get(struct snd_kcontrol *kcontrol,
unsigned int slave_port_idx = SWR_DMIC_MAX_PORTS;
if (NULL == component) {
pr_err("%s: swr dmic component is NULL\n", __func__);
pr_err_ratelimited("%s: swr dmic component is NULL\n", __func__);
return -EINVAL;
}
swr_dmic = snd_soc_component_get_drvdata(component);
if (NULL == swr_dmic) {
pr_err("%s: swr_dmic_priv is NULL\n", __func__);
pr_err_ratelimited("%s: swr_dmic_priv is NULL\n", __func__);
return -EINVAL;
}
@@ -156,7 +157,7 @@ static int swr_dmic_tx_master_port_get(struct snd_kcontrol *kcontrol,
}
if (slave_port_idx >= SWR_DMIC_MAX_PORTS) {
pr_err("%s: invalid slave port id\n", __func__);
pr_err_ratelimited("%s: invalid slave port id\n", __func__);
return -EINVAL;
}
@@ -181,13 +182,13 @@ static int swr_dmic_tx_master_port_put(struct snd_kcontrol *kcontrol,
unsigned int idx = 0;
if (NULL == component) {
pr_err("%s: swr dmic component is NULL\n", __func__);
pr_err_ratelimited("%s: swr dmic component is NULL\n", __func__);
return -EINVAL;
}
swr_dmic = snd_soc_component_get_drvdata(component);
if (NULL == swr_dmic) {
pr_err("%s: swr_dmic_priv is NULL\n", __func__);
pr_err_ratelimited("%s: swr_dmic_priv is NULL\n", __func__);
return -EINVAL;
}
@@ -199,7 +200,7 @@ static int swr_dmic_tx_master_port_put(struct snd_kcontrol *kcontrol,
}
if (slave_port_idx >= SWR_DMIC_MAX_PORTS) {
pr_err("%s: invalid slave port id\n", __func__);
pr_err_ratelimited("%s: invalid slave port id\n", __func__);
return -EINVAL;
}
@@ -262,7 +263,7 @@ static int dmic_swr_ctrl(struct snd_soc_dapm_widget *w,
if (port_id >= SWR_DMIC_MAX_PORTS)
{
dev_err(component->dev, "%s: invalid port id: %d\n",
dev_err_ratelimited(component->dev, "%s: invalid port id: %d\n",
__func__, port_id);
return -EINVAL;
}
@@ -518,7 +519,7 @@ static int enable_wcd_codec_supply(struct swr_dmic_priv *swr_dmic, bool enable)
struct snd_soc_component *component = swr_dmic->supply_component;
if (!component) {
pr_err("%s: component is NULL\n", __func__);
pr_err_ratelimited("%s: component is NULL\n", __func__);
return -EINVAL;
}
dev_dbg(component->dev, "%s: supply %d micbias: %d enable: %d\n",
@@ -785,7 +786,7 @@ static int swr_dmic_up(struct swr_device *pdev)
swr_dmic = swr_get_dev_data(pdev);
if (!swr_dmic) {
dev_err(&pdev->dev, "%s: swr_dmic is NULL\n", __func__);
dev_err_ratelimited(&pdev->dev, "%s: swr_dmic is NULL\n", __func__);
return -EINVAL;
}
@@ -803,7 +804,7 @@ static int swr_dmic_down(struct swr_device *pdev)
swr_dmic = swr_get_dev_data(pdev);
if (!swr_dmic) {
dev_err(&pdev->dev, "%s: swr_dmic is NULL\n", __func__);
dev_err_ratelimited(&pdev->dev, "%s: swr_dmic is NULL\n", __func__);
return -EINVAL;
}
@@ -831,7 +832,7 @@ static int swr_dmic_reset(struct swr_device *pdev)
swr_dmic = swr_get_dev_data(pdev);
if (!swr_dmic) {
dev_err(&pdev->dev, "%s: swr_dmic is NULL\n", __func__);
dev_err_ratelimited(&pdev->dev, "%s: swr_dmic is NULL\n", __func__);
return -EINVAL;
}
@@ -857,7 +858,7 @@ static int swr_dmic_resume(struct device *dev)
struct swr_dmic_priv *swr_dmic = swr_get_dev_data(to_swr_device(dev));
if (!swr_dmic) {
dev_err(dev, "%s: swr_dmic private data is NULL\n", __func__);
dev_err_ratelimited(dev, "%s: swr_dmic private data is NULL\n", __func__);
return -EINVAL;
}
dev_dbg(dev, "%s: system resume\n", __func__);