OSDN Git Service

ASoC: soc-core: add new soc_link_init()
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Wed, 4 Sep 2019 00:15:12 +0000 (09:15 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 9 Sep 2019 10:02:57 +0000 (11:02 +0100)
commitc4b4698291a1d1c55665ae906779d1b685d5aa66
treec09e3327a087a05162714bf50c1b4846c911b7fc
parenta7d44f78063d642406132c2ed1dc6033d0d03cfe
ASoC: soc-core: add new soc_link_init()

Current soc_probe_link_dais() (1) is called under probe_order (2),
and it will initialize dai_link related settings at *Last* turn (3)(B).
It is very complex code.

static int soc_probe_link_dais(..., order)
{
(A) /* probe DAIs here */
...

(3) if (order != SND_SOC_COMP_ORDER_LAST)
return 0;

(B) /* initialize dai_link related settings */
...
}

static int snd_soc_instantiate_card(...)
{
...
(2) for_each_comp_order(order) {
for_each_card_rtds(...) {
(1) ret = soc_probe_link_dais(..., order);
}
}
}

This patch separes soc_probe_link_dais() into "DAI probe" portion (A),
and dai_link settings portion (B).
The later is named as soc_link_init() by this patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87y2z4or1r.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-core.c