diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2021-09-01 12:52:54 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-09-20 13:30:17 +0100 |
commit | a739fdc26211952edb34bf1ac9ed7afe220a5d54 (patch) | |
tree | b7cc26409e9f38e4c89e8905cf643d91906b2143 /sound/soc/soc-component.c | |
parent | 2266721938b9d12ebf4f2cd96b88912ffa4f5e91 (diff) |
ASoC: soc-component: Convert the mark_module to void*
The mark_module of the snd_soc_component is strict snd_pcm_substream type
which prevents it to be used by compressed streams.
Change the type to void* along with the snd_soc_component_module_get()
and snd_soc_component_module_put() to allow the same mark to be used by
compressed when it's module_get_upon_open is set to 1.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210901095255.3617-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-component.c')
-rw-r--r-- | sound/soc/soc-component.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index 8e8d917d22f8..82a1430313dc 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -251,8 +251,7 @@ int snd_soc_component_set_jack(struct snd_soc_component *component, EXPORT_SYMBOL_GPL(snd_soc_component_set_jack); int snd_soc_component_module_get(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - int upon_open) + void *mark, int upon_open) { int ret = 0; @@ -260,25 +259,24 @@ int snd_soc_component_module_get(struct snd_soc_component *component, !try_module_get(component->dev->driver->owner)) ret = -ENODEV; - /* mark substream if succeeded */ + /* mark module if succeeded */ if (ret == 0) - soc_component_mark_push(component, substream, module); + soc_component_mark_push(component, mark, module); return soc_component_ret(component, ret); } void snd_soc_component_module_put(struct snd_soc_component *component, - struct snd_pcm_substream *substream, - int upon_open, int rollback) + void *mark, int upon_open, int rollback) { - if (rollback && !soc_component_mark_match(component, substream, module)) + if (rollback && !soc_component_mark_match(component, mark, module)) return; if (component->driver->module_get_upon_open == !!upon_open) module_put(component->dev->driver->owner); - /* remove marked substream */ - soc_component_mark_pop(component, substream, module); + /* remove the mark from module */ + soc_component_mark_pop(component, mark, module); } int snd_soc_component_open(struct snd_soc_component *component, |