From 35ea0655a1bcdb1dcb1c1d0c4b6b391ade9c6d01 Mon Sep 17 00:00:00 2001 From: Liam Girdwood Date: Tue, 5 Jun 2012 19:26:59 +0100 Subject: [PATCH] ASoC: dpcm: Fix dpcm_get_be() to check that DAI is BE Make sure that the dpcm_get_be() only returns BE DAI links. Signed-off-by: Liam Girdwood Signed-off-by: Mark Brown --- sound/soc/soc-pcm.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index bedd1717a373..48fd15b312c1 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c @@ -794,6 +794,9 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, for (i = 0; i < card->num_links; i++) { be = &card->rtd[i]; + if (!be->dai_link->no_pcm) + continue; + if (be->cpu_dai->playback_widget == widget || be->codec_dai->playback_widget == widget) return be; @@ -803,6 +806,9 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, for (i = 0; i < card->num_links; i++) { be = &card->rtd[i]; + if (!be->dai_link->no_pcm) + continue; + if (be->cpu_dai->capture_widget == widget || be->codec_dai->capture_widget == widget) return be; -- 2.20.1