OSDN Git Service

ASoC: soc-pcm: tidyup soc_pcm_open() order
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 10 Feb 2020 03:14:45 +0000 (12:14 +0900)
committerMark Brown <broonie@kernel.org>
Wed, 12 Feb 2020 23:52:26 +0000 (23:52 +0000)
commit5d9fa03e6c3514266fa94851ab1b6dd6e0595a13
treec776f2fb63133e6662ec880a256843189a503fe2
parent62c86d1d5fd942c741791be94f670b99ffedfb5c
ASoC: soc-pcm: tidyup soc_pcm_open() order

soc_pcm_open() operation order is not good.
At first, soc_pcm_open() operation order is

1) CPU DAI startup
2) Component open
3) Codec DAI startup
4) rtd startup

But here, 2) will call try_module_get() if component has
module_get_upon_open flags. This means 1) CPU DAI startup
will be operated *before* its module was loaded.
DAI should be called *after* Component.

Second, soc_pcm_close() operation order is
1) CPU DAI shutdown
2) Codec DAI shutdown
3) rtd shutdown
4) Component close

soc_pcm_open() and soc_pcm_close() are paired function,
but, its operation order is unbalance.
This patch tidyup soc_pcm_open() order to Component -> rtd -> DAI.
This is one of prepare for cleanup soc-pcm-open()

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Link: https://lore.kernel.org/r/871rr3cext.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-pcm.c