]> git.baikalelectronics.ru Git - kernel.git/commit
Merge series "ASoC: merge soc_pcm_hw_param() rollback and soc_pcm_hw_free()" from...
authorMark Brown <broonie@kernel.org>
Mon, 26 Oct 2020 18:37:15 +0000 (18:37 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 26 Oct 2020 18:37:15 +0000 (18:37 +0000)
commit7e0e5f819b444e4d6c78f5bdbc14352bac999d21
treea7331b1ee07ac47c9b7321b80c5f5c740a02d08a
parente984e3a5eeecb1e11416e64dd5c0fc58ee7dafb2
parent834c2223e307fe29d6ea0993c39e38e1dcf835bd
Merge series "ASoC: merge soc_pcm_hw_param() rollback and soc_pcm_hw_free()" from Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>:

Hi Mark

soc_pcm_hw_params() does rollback when failed (A),
but, it is almost same as soc_pcm_hw_free().

static int soc_pcm_hw_params(xxx)
{
...
if (ret < 0)
goto xxx_err;
...
return ret;

 ^ component_err:
 | ...
 | interface_err:
(A) ...
 | codec_err:
 | ...
 v return ret;
}

This kind of duplicated code can be a hotbed of bugs,
thus, this patch-set share soc_pcm_hw_free() and rollback.

Kuninori Morimoto (6):
  ASoC: soc.h: remove for_each_rtd_dais_rollback()
  ASoC: soc-pcm: move soc_pcm_hw_free() next to soc_pcm_hw_params()
  ASoC: soc-link: add mark for snd_soc_link_hw_params/free()
  ASoC: soc-component: add mark for snd_soc_pcm_component_hw_params/free()
  ASoC: soc-dai: add mark for snd_soc_dai_hw_params/free()
  ASoC: soc-pcm: add soc_pcm_hw_clean() and call it from soc_pcm_hw_params/free()

 include/sound/soc-component.h |   6 +-
 include/sound/soc-dai.h       |   4 +-
 include/sound/soc-link.h      |   3 +-
 include/sound/soc.h           |   7 +-
 sound/soc/soc-component.c     |  19 ++---
 sound/soc/soc-dai.c           |  13 +++-
 sound/soc/soc-dapm.c          |   4 +-
 sound/soc/soc-link.c          |  12 +++-
 sound/soc/soc-pcm.c           | 131 ++++++++++++++--------------------
 9 files changed, 97 insertions(+), 102 deletions(-)

--
2.25.1
sound/soc/soc-dapm.c