ASoC: soc-core: remove duplicated soc_is_dai_link_bound()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 5 Nov 2019 06:46:15 +0000 (15:46 +0900)
committerMark Brown <broonie@kernel.org>
Tue, 5 Nov 2019 23:49:55 +0000 (23:49 +0000)
commit95b562e57f0b3a21a3945297862cb51bc2072c7b
tree9ddea6d9e018ef34f23125cc05600766c5e743cd
parentcd3c5ad7b2503f4fb4dfcc095b3fccc2b3603c36
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 <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/87a79a3jns.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c