All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH v2 8/8] ASoC: soc-pcm: tidyup dulicate handing at dpcm_fe_dai_startup()
Date: 27 Feb 2020 10:55:13 +0900	[thread overview]
Message-ID: <87d0a07q0u.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87o8tk7q34.wl-kuninori.morimoto.gx@renesas.com>

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 --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;
-- 
2.17.1


      parent reply	other threads:[~2020-02-27  1:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-27  1:53 [PATCH v2 0/8] ASoC: soc-pcm cleanup step5 Kuninori Morimoto
2020-02-27  1:54 ` [PATCH v2 1/8] ASoC: soc-pcm: use defined stream Kuninori Morimoto
2020-02-27  1:54 ` [PATCH v2 2/8] ASoC: soc-pcm: remove duplicate be check from dpcm_add_paths() Kuninori Morimoto
2020-02-27  1:54 ` [PATCH v2 3/8] ASoC: soc-pcm: move dpcm_fe_dai_close() Kuninori Morimoto
2020-03-05 12:45   ` Mark Brown
2020-02-27  1:54 ` [PATCH v2 4/8] ASoC: soc-pcm: add dpcm_fe_dai_cleanup() Kuninori Morimoto
2020-02-27  1:55 ` [PATCH v2 5/8] ASoC: soc-pcm: use snd_soc_dai_get_pcm_stream() at dpcm_set_fe_runtime() Kuninori Morimoto
2020-02-27  1:55 ` [PATCH v2 6/8] ASoC: soc-pcm: check DAI's activity more simply Kuninori Morimoto
2020-02-27  2:38   ` Kuninori Morimoto
2020-02-27 12:37     ` Mark Brown
2020-02-28  0:12       ` Kuninori Morimoto
2020-02-27  1:55 ` [PATCH v2 7/8] ASoC: soc-pcm: Do Digital Mute for both CPU/Codec in same timing Kuninori Morimoto
2020-02-27  1:55 ` Kuninori Morimoto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0a07q0u.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.