diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2019-07-26 06:50:07 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-08-05 17:18:06 +0200 |
commit | 3672beb8cad6beb7b8c017514aef0f4f507debcf (patch) | |
tree | 69d97094c22566fa5052156fadf48b20e6bafc32 /sound/soc/soc-component.c | |
parent | ASoC: soc-component: add snd_soc_component_open() (diff) | |
download | linux-3672beb8cad6beb7b8c017514aef0f4f507debcf.tar.xz linux-3672beb8cad6beb7b8c017514aef0f4f507debcf.zip |
ASoC: soc-component: add snd_soc_component_close()
Current ALSA SoC is directly using component->driver->ops->xxx,
thus, it is deep nested, and makes code difficult to read,
and is not good for encapsulation.
This patch adds new snd_soc_component_close() and use it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87ef2d5rnr.wl-kuninori.morimoto.gx@renesas.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 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c index ada46f9729b2..cee66183470d 100644 --- a/sound/soc/soc-component.c +++ b/sound/soc/soc-component.c @@ -295,3 +295,13 @@ int snd_soc_component_open(struct snd_soc_component *component, return 0; } + +int snd_soc_component_close(struct snd_soc_component *component, + struct snd_pcm_substream *substream) +{ + if (component->driver->ops && + component->driver->ops->close) + return component->driver->ops->close(substream); + + return 0; +} |