Commit 1fb2d9d7 authored by Nicolin Chen's avatar Nicolin Chen Committed by Mark Brown

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: default avatarNicolin Chen <Guangyu.Chen@freescale.com>
Reviewed-by: default avatarXiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent dd9f4060
...@@ -111,7 +111,7 @@ static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai, ...@@ -111,7 +111,7 @@ static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
dev_err(cpu_dai->dev, dev_err(cpu_dai->dev,
"Cannot set SAI's transmitter sysclk: %d\n", "Cannot set SAI's transmitter sysclk: %d\n",
ret); ret);
return ret; goto err_clk;
} }
ret = fsl_sai_set_dai_sysclk_tr(cpu_dai, clk_id, freq, 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, ...@@ -120,12 +120,13 @@ static int fsl_sai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
dev_err(cpu_dai->dev, dev_err(cpu_dai->dev,
"Cannot set SAI's receiver sysclk: %d\n", "Cannot set SAI's receiver sysclk: %d\n",
ret); ret);
return ret; goto err_clk;
} }
err_clk:
clk_disable_unprepare(sai->clk); clk_disable_unprepare(sai->clk);
return 0; return ret;
} }
static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, 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) ...@@ -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, dev_err(cpu_dai->dev,
"Cannot set SAI's transmitter format: %d\n", "Cannot set SAI's transmitter format: %d\n",
ret); ret);
return ret; goto err_clk;
} }
ret = fsl_sai_set_dai_fmt_tr(cpu_dai, fmt, FSL_FMT_RECEIVER); 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) ...@@ -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, dev_err(cpu_dai->dev,
"Cannot set SAI's receiver format: %d\n", "Cannot set SAI's receiver format: %d\n",
ret); ret);
return ret; goto err_clk;
} }
err_clk:
clk_disable_unprepare(sai->clk); clk_disable_unprepare(sai->clk);
return 0; return ret;
} }
static int fsl_sai_hw_params(struct snd_pcm_substream *substream, static int fsl_sai_hw_params(struct snd_pcm_substream *substream,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment