Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35ea0655 authored by Liam Girdwood's avatar Liam Girdwood Committed by Mark Brown
Browse files

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: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent bfd37bb5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;