summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2020-02-17 17:28:11 +0900
committerMark Brown <broonie@kernel.org>2020-02-18 23:37:04 +0000
commitcae06eb92557f0a073835380e57abee5f8173d73 (patch)
treefac454c3fc0b2c3007e28c51b6901ba07bb75b24
parent085d22be035db245c44714cf879a73eae06c9f6b (diff)
downloadlinux-stable-cae06eb92557f0a073835380e57abee5f8173d73.tar.gz
linux-stable-cae06eb92557f0a073835380e57abee5f8173d73.tar.bz2
linux-stable-cae06eb92557f0a073835380e57abee5f8173d73.zip
ASoC: soc-pcm: use goto and remove multi return
When we use some kind of lock, we need to do unlock. In that time, multi unlock/return is not good implementation. This patch add label and use goto at dpcm_fe_dai_open() to reduce such code. 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> Link: https://lore.kernel.org/r/877e0lboty.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/soc-pcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index d77a2c22a04f..5a79a830ee18 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -2733,8 +2733,7 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
ret = dpcm_path_get(fe, stream, &list);
if (ret < 0) {
- mutex_unlock(&fe->card->mutex);
- return ret;
+ goto open_end;
} else if (ret == 0) {
dev_dbg(fe->dev, "ASoC: %s no valid %s route\n",
fe->dai_link->name, stream ? "capture" : "playback");
@@ -2755,6 +2754,7 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream)
dpcm_clear_pending_state(fe, stream);
dpcm_path_put(&list);
+open_end:
mutex_unlock(&fe->card->mutex);
return ret;
}