aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKai Vehmanen2020-02-20 11:49:55 +0200
committerMark Brown2020-02-24 21:48:24 +0000
commitd2aaa8d8bfba93237ac944ee058fb98e2c2ef983 (patch)
tree0f19bcd8993bf9c7fda39692ffe0edb3eba24ac4 /include
parent1640c8df0bbac9e5156132e24c0f0a932c2b2865 (diff)
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 dd03907bf129 ("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: dd03907bf129 ("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>
Diffstat (limited to 'include')
-rw-r--r--include/sound/soc-component.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/include/sound/soc-component.h b/include/sound/soc-component.h
index 1866ecc8e94b..154d02fbbfed 100644
--- a/include/sound/soc-component.h
+++ b/include/sound/soc-component.h
@@ -147,6 +147,8 @@ struct snd_soc_component {
unsigned int active;
+ unsigned int suspended:1; /* is in suspend PM state */
+
struct list_head list;
struct list_head card_aux_list; /* for auxiliary bound components */
struct list_head card_list;
@@ -180,11 +182,6 @@ struct snd_soc_component {
struct dentry *debugfs_root;
const char *debugfs_prefix;
#endif
-
- /* bit field */
- unsigned int suspended:1; /* is in suspend PM state */
- unsigned int opened:1;
- unsigned int module:1;
};
#define for_each_component_dais(component, dai)\