ASoc: soc-pcm: Move dev_warn to pr_warn_ratelimited

- Kernel messages are getting flooded with warning
  messages when no valid routing found from source
  to sink
- Ratelimit the warning messages

Signed-off-by: SathishKumar Mani <smani@codeaurora.org>
This commit is contained in:
SathishKumar Mani 2012-10-09 13:31:13 -07:00 committed by Iliyan Malchev
parent 2b3bd90bcc
commit 453e0966b1

View file

@ -26,6 +26,7 @@
#include <linux/dma-mapping.h>
#include <linux/export.h>
#include <linux/bug.h>
#include <linux/ratelimit.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@ -2025,7 +2026,7 @@ int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *widget)
paths = fe_path_get(fe, SNDRV_PCM_STREAM_PLAYBACK, &list);
if (paths < 0) {
dev_warn(fe->dev, "%s no valid %s route from source to sink\n",
pr_warn_ratelimited("%s no valid %s route from source to sink\n",
fe->dai_link->name, "playback");
WARN_ON(1);
ret = paths;
@ -2055,7 +2056,7 @@ capture:
paths = fe_path_get(fe, SNDRV_PCM_STREAM_CAPTURE, &list);
if (paths < 0) {
dev_warn(fe->dev, "%s no valid %s route from source to sink\n",
pr_warn_ratelimited("%s no valid %s route from source to sink\n",
fe->dai_link->name, "capture");
ret = paths;
goto out;
@ -2431,7 +2432,7 @@ int soc_dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
fe->dpcm[stream].runtime = fe_substream->runtime;
if (fe_path_get(fe, stream, &list) <= 0) {
dev_warn(fe->dev, "asoc: %s no valid %s route from source to sink\n",
pr_warn_ratelimited("asoc: %s no valid %s route from source to sink\n",
fe->dai_link->name, stream ? "capture" : "playback");
return -EINVAL;
}