[PATCH 2/8] ASoC: soc-pcm: remove duplicate be check from dpcm_add_paths()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Wed Feb 26 07:40:07 CET 2020


From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>

dpcm_add_paths() checks returned be from dpcm_get_be()

	static int dpcm_add_paths(...)
	{
		...
		for_each_dapm_widgets(list, i, widget) {
			...
			be = dpcm_get_be(...);
			...
			/* make sure BE is a real BE */
=>			if (!be->dai_link->no_pcm)
				continue;
			...
		}
		...
	}

But, dpcm_get_be() itself is checking it already.

	dpcm_get_be(...)
	{
		...
		for_each_card_rtds(card, be) {
=>			if (!be->dai_link->no_pcm)
				continue;
			...
			if (...)
=>				return be;
		}

		return NULL
	}

This patch removes duplicate check

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
---
 sound/soc/soc-pcm.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 8c27eb4d5e4c..e3a2c4f7757b 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -1690,10 +1690,6 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream,
 			continue;
 		}
 
-		/* make sure BE is a real BE */
-		if (!be->dai_link->no_pcm)
-			continue;
-
 		/* don't connect if FE is not running */
 		if (!fe->dpcm[stream].runtime && !fe->fe_compr)
 			continue;
-- 
2.17.1



More information about the Alsa-devel mailing list