]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: soc-pcm: fix state tracking error in snd_soc_component_open/close()
authorKai Vehmanen <kai.vehmanen@linux.intel.com>
Thu, 20 Feb 2020 09:49:55 +0000 (11:49 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 24 Feb 2020 21:48:24 +0000 (21:48 +0000)
commitf01bb0ced6c15c558da34301760e393f9175a270
tree0f19bcd8993bf9c7fda39692ffe0edb3eba24ac4
parent6be20a0e236fe44f2c5976aa7eca8fb354479acc
ASoC: soc-pcm: fix state tracking error in snd_soc_component_open/close()

ASoC component open/close and snd_soc_component_module_get/put are called
independently for each component-substream pair, so the logic added in
commit f6c5a99c3829 ("ASoC: soc-pcm: call snd_soc_component_open/close()
once") was not sufficient and led to PCM playback and module unload errors.

Implement handling of failures directly in soc_pcm_components_open(),
so that any successfully opened components are closed upon error with
other components. This allows to clean up error handling in
soc_pcm_open() without adding more state tracking.

Fixes: f6c5a99c3829 ("ASoC: soc-pcm: call snd_soc_component_open/close() once")
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20200220094955.16968-1-kai.vehmanen@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-component.h
sound/soc/soc-component.c
sound/soc/soc-pcm.c