soc: define ratelimit for prints to avoid flooding of logs
Change-Id: I7aa38c992716152ebb336190d9d3cd2e9a60e8e0 Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
3038c0281b
commit
ecbb93d98d
@@ -189,8 +189,9 @@ static int lpass_hw_vote_prepare(struct clk_hw *hw)
|
|||||||
&clk_priv->lpass_core_hwvote_client_handle);
|
&clk_priv->lpass_core_hwvote_client_handle);
|
||||||
#endif
|
#endif
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
pr_err("%s lpass core hw vote failed %d\n",
|
if (__ratelimit(&rtl))
|
||||||
__func__, ret);
|
pr_err("%s lpass core hw vote failed %d\n",
|
||||||
|
__func__, ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -497,6 +497,7 @@ static int swrm_get_ssp_period(struct swr_mstr_ctrl *swrm,
|
|||||||
static int swrm_core_vote_request(struct swr_mstr_ctrl *swrm, bool enable)
|
static int swrm_core_vote_request(struct swr_mstr_ctrl *swrm, bool enable)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
static DEFINE_RATELIMIT_STATE(rtl, 1 * HZ, 1);
|
||||||
|
|
||||||
if (!swrm->handle)
|
if (!swrm->handle)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -509,8 +510,9 @@ static int swrm_core_vote_request(struct swr_mstr_ctrl *swrm, bool enable)
|
|||||||
if (swrm->core_vote) {
|
if (swrm->core_vote) {
|
||||||
ret = swrm->core_vote(swrm->handle, enable);
|
ret = swrm->core_vote(swrm->handle, enable);
|
||||||
if (ret)
|
if (ret)
|
||||||
dev_err_ratelimited(swrm->dev,
|
if (__ratelimit(&rtl))
|
||||||
"%s: core vote request failed\n", __func__);
|
dev_err_ratelimited(swrm->dev,
|
||||||
|
"%s: core vote request failed\n", __func__);
|
||||||
}
|
}
|
||||||
exit:
|
exit:
|
||||||
mutex_unlock(&swrm->clklock);
|
mutex_unlock(&swrm->clklock);
|
||||||
|
Reference in New Issue
Block a user