Skip to content

Commit

Permalink
ASoC: dpcm: Fix dpcm_get_be() to check that DAI is BE
Browse files Browse the repository at this point in the history
Make sure that the dpcm_get_be() only returns BE DAI links.

Signed-off-by: Liam Girdwood <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
lrg-ti authored and broonie committed Jun 7, 2012
1 parent bfd37bb commit 35ea065
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sound/soc/soc-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 35ea065

Please sign in to comment.