From: Kuninori Morimoto Date: Tue, 5 Nov 2019 06:46:15 +0000 (+0900) Subject: ASoC: soc-core: remove duplicated soc_is_dai_link_bound() X-Git-Tag: v5.10.7~3493^2~20^2~102 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95b562e57f0b3a21a3945297862cb51bc2072c7b;p=platform%2Fkernel%2Flinux-rpi.git ASoC: soc-core: remove duplicated soc_is_dai_link_bound() soc_is_dai_link_bound() check will be called both *before* soc_bind_dai_link() (A), and *under* soc_bind_dai_link() (B). These are very verbose code. Let's remove one of them. * static int soc_bind_dai_link(...) { ... (B) if (soc_is_dai_link_bound(...)) { ... return 0; } ... } static int snd_soc_instantiate_card(...) { ... for_each_card_links(...) { (A) if (soc_is_dai_link_bound(...)) continue; * ret = soc_bind_dai_link(...); if (ret) goto probe_end; } ... } Signed-off-by: Kuninori Morimoto Reviewed-by: Pierre-Louis Bossart Reviewed-by: Ranjani Sridharan Link: https://lore.kernel.org/r/87a79a3jns.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index e1b0d86..3cc36c2 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -2065,9 +2065,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card) * Components with topology may bring new DAIs and DAI links. */ for_each_card_links(card, dai_link) { - if (soc_is_dai_link_bound(card, dai_link)) - continue; - ret = soc_bind_dai_link(card, dai_link); if (ret) goto probe_end;