diff mbox series

[v2,8/8] ASoC: soc-pcm: tidyup dulicate handing at dpcm_fe_dai_startup()

Message ID 87d0a07q0u.wl-kuninori.morimoto.gx@renesas.com
State Accepted
Commit 8a01fbf0ac115268293d8764850edc0628a58e4f
Headers show
Series ASoC: soc-pcm cleanup step5 | expand

Commit Message

Kuninori Morimoto Feb. 27, 2020, 1:55 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Error handling at dpcm_fe_dai_startup() has duplicate code.
This patch tidyup it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
v1 -> v2

	- add Reviewed-by from Ranjani / Pierre-Louis
	- remove unneeded "goto unwind"

 sound/soc/soc-pcm.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index ea900ab06d84..5222f758b007 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2158,17 +2158,13 @@  static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream)
 	snd_pcm_limit_hw_rates(runtime);
 
 	ret = dpcm_apply_symmetry(fe_substream, stream);
-	if (ret < 0) {
+	if (ret < 0)
 		dev_err(fe->dev, "ASoC: failed to apply dpcm symmetry %d\n",
 			ret);
-		goto unwind;
-	}
-
-	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
-	return 0;
 
 unwind:
-	dpcm_be_dai_startup_unwind(fe, stream);
+	if (ret < 0)
+		dpcm_be_dai_startup_unwind(fe, stream);
 be_err:
 	dpcm_set_fe_update_state(fe, stream, SND_SOC_DPCM_UPDATE_NO);
 	return ret;