ASoC: compress/component: Use module_get_when_open/put_when_close for cstream
authorPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Wed, 1 Sep 2021 09:52:55 +0000 (12:52 +0300)
committerMark Brown <broonie@kernel.org>
Mon, 20 Sep 2021 12:30:18 +0000 (13:30 +0100)
commitcd46f3824480740879d2c15d65c6e6b038f96021
tree71ffe74fd1d72ebb6ddce68483f42bea335e46e2
parenta739fdc26211952edb34bf1ac9ed7afe220a5d54
ASoC: compress/component: Use module_get_when_open/put_when_close for cstream

Currently the try_module_get() and module_put() is not possible for
compressed streams if the module_get_upon_open is set to 1 which means that\
the components are not protected in a same way as components when normal
audio is used.

SOF is setting module_get_upon_open to 1 for component drivers which works
correctly for audio stream but when compressed stream is used then the
module is not protected.

Convert the compress open and free operation to mimic the steps of it's
pcm counterpart to fix this issue.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Link: https://lore.kernel.org/r/20210901095255.3617-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-component.h
sound/soc/soc-component.c
sound/soc/soc-compress.c