diff options
author | Shengjiu Wang <shengjiu.wang@freescale.com> | 2015-12-22 16:57:06 +0800 |
---|---|---|
committer | Octavian Purdila <octavian.purdila@nxp.com> | 2017-02-23 14:21:42 +0200 |
commit | fd41dfeb7977aec68579eda9c546fef6ee481b13 (patch) | |
tree | 7c19e2a8b3d802d1dc6a36bd81ba9994f9e79b47 /sound | |
parent | 3744df96aff9fdb62e4cd5ddadc292232ce02a8c (diff) |
MLK-12043: ASoC: fsl: imx-cs42888: Add return value check
Report by coverity (CID 18428). The return value need be checked
for snd_soc_dai_set_sysclk().
Signed-off-by: Shengjiu Wang <shengjiu.wang@freescale.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/fsl/imx-cs42888.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/soc/fsl/imx-cs42888.c b/sound/soc/fsl/imx-cs42888.c index 681788659cff..dea5a9a7e8f9 100644 --- a/sound/soc/fsl/imx-cs42888.c +++ b/sound/soc/fsl/imx-cs42888.c @@ -55,12 +55,22 @@ static int imx_cs42888_surround_hw_params(struct snd_pcm_substream *substream, dai_format = SND_SOC_DAIFMT_LEFT_J | SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_CBS_CFS; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - snd_soc_dai_set_sysclk(cpu_dai, ESAI_HCKT_EXTAL, + ret = snd_soc_dai_set_sysclk(cpu_dai, ESAI_HCKT_EXTAL, priv->mclk_freq, SND_SOC_CLOCK_OUT); else - snd_soc_dai_set_sysclk(cpu_dai, ESAI_HCKR_EXTAL, + ret = snd_soc_dai_set_sysclk(cpu_dai, ESAI_HCKR_EXTAL, priv->mclk_freq, SND_SOC_CLOCK_OUT); - snd_soc_dai_set_sysclk(codec_dai, 0, priv->mclk_freq, SND_SOC_CLOCK_IN); + if (ret) { + dev_err(dev, "failed to set cpu sysclk: %d\n", ret); + return ret; + } + + ret = snd_soc_dai_set_sysclk(codec_dai, 0, + priv->mclk_freq, SND_SOC_CLOCK_IN); + if (ret) { + dev_err(dev, "failed to set codec sysclk: %d\n", ret); + return ret; + } /* set cpu DAI configuration */ ret = snd_soc_dai_set_fmt(cpu_dai, dai_format); |