summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorNicolin Chen <Guangyu.Chen@freescale.com>2013-12-20 08:41:00 (GMT)
committerMatthew Weigel <Matthew.Weigel@freescale.com>2014-12-11 18:36:20 (GMT)
commitbd4069918cb3df50208967f35b32b75a0aa3679b (patch)
tree50b31034b40d6e64c4268f27688a36827f2fb3bd /sound
parentc76d07be6739d1bfe90929ff10ff676cf54e9e7f (diff)
downloadlinux-fsl-qoriq-bd4069918cb3df50208967f35b32b75a0aa3679b.tar.xz
ASoC: fsl_sai: Keep symmetry for clk_enable() and clk_disable()
There are two functions haven't clk_disable_unprepare() if having error. Thus fix them. Signed-off-by: Nicolin Chen <Guangyu.Chen@freescale.com> Reviewed-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org> --- This patch is pulled back from upstream: commit 1fb2d9d7465bcbb519c582fa4a3bd04ff4fce2d2 Change-Id: Ia4a2525d2e32949f2092fcd4de86d46ada27b096 Reviewed-on: http://git.am.freescale.net:8181/19740 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/fsl/fsl_sai.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index 5194355..e19dd95 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -111,7 +111,7 @@ static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
dev_err(cpu_dai->dev,
"Cannot set SAI's transmitter sysclk: %d\n",
ret);
- return ret;
+ goto err_clk;
}
ret = fsl_sai_set_dai_sysclk_tr(cpu_dai, clk_id, freq,
@@ -120,12 +120,13 @@ static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
dev_err(cpu_dai->dev,
"Cannot set SAI's receiver sysclk: %d\n",
ret);
- return ret;
+ goto err_clk;
}
+err_clk:
clk_disable_unprepare(sai->clk);
- return 0;
+ return ret;
}
static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai,
@@ -222,7 +223,7 @@ static int fsl_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
dev_err(cpu_dai->dev,
"Cannot set SAI's transmitter format: %d\n",
ret);
- return ret;
+ goto err_clk;
}
ret = fsl_sai_set_dai_fmt_tr(cpu_dai, fmt, FSL_FMT_RECEIVER);
@@ -230,12 +231,13 @@ static int fsl_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
dev_err(cpu_dai->dev,
"Cannot set SAI's receiver format: %d\n",
ret);
- return ret;
+ goto err_clk;
}
+err_clk:
clk_disable_unprepare(sai->clk);
- return 0;
+ return ret;
}
static int fsl_sai_hw_params(struct snd_pcm_substream *substream,