[PATCH 0/5] ASoC: merge soc_compr_open() rollback and soc_compr_free()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Nov 19 00:49:32 CET 2020


Hi Mark

soc_compr_open() does rollback when failed (A),
but, it is almost same as soc_compr_free().

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

 ^	machine_err:
 |		...
 |	out:
(A)		...
 |	pm_err:
 |		...
 v		return ret;
	}

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

Kuninori Morimoto (5):
  ASoC: soc-compress: move soc_compr_free() next to soc_compr_open()
  ASoC: soc-dai: add mark for snd_soc_dai_compr_startup/shutdown()
  ASoC: soc-component: add mark for snd_soc_component_compr_open/free()
  ASoC: soc-component: add mark for snd_soc_link_compr_startup/shutdown()
  ASoC: soc-compress: add soc_compr_clean() and call it from soc_compr_open/free()

 include/sound/soc-component.h |   6 +-
 include/sound/soc-dai.h       |   4 +-
 include/sound/soc-link.h      |   3 +-
 include/sound/soc.h           |   1 +
 sound/soc/soc-component.c     |  17 +++--
 sound/soc/soc-compress.c      | 115 +++++++++++++++++-----------------
 sound/soc/soc-dai.c           |  13 +++-
 sound/soc/soc-link.c          |  11 +++-
 8 files changed, 95 insertions(+), 75 deletions(-)

-- 
2.25.1



More information about the Alsa-devel mailing list