summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>2021-02-20 00:09:14 +0100
committerMark Brown <broonie@kernel.org>2021-03-10 14:06:50 +0100
commit0587e83c5d8bc09af005bd736234b480a8fd66f2 (patch)
tree2aa5826085436e142515ab2c62459f5dc3b9fc9b
parentASoC: samsung: i2s: remove unassigned variable (diff)
downloadlinux-0587e83c5d8bc09af005bd736234b480a8fd66f2.tar.xz
linux-0587e83c5d8bc09af005bd736234b480a8fd66f2.zip
ASoC: samsung: s3c24xx_simtec: add missing error check
cppcheck warning: sound/soc/samsung/s3c24xx_simtec.c:191:7: style: Variable 'ret' is assigned a value that is never used. [unreadVariable] ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER, ^ Looking at the code, it's not clear why the return value is checked in the two other cases but not here, so mirror the behavior and add a check. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20210219230918.5058-3-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/samsung/s3c24xx_simtec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/samsung/s3c24xx_simtec.c b/sound/soc/samsung/s3c24xx_simtec.c
index 3cddd11344ac..81a29d12c57d 100644
--- a/sound/soc/samsung/s3c24xx_simtec.c
+++ b/sound/soc/samsung/s3c24xx_simtec.c
@@ -190,6 +190,11 @@ static int simtec_hw_params(struct snd_pcm_substream *substream,
ret = snd_soc_dai_set_clkdiv(cpu_dai, S3C24XX_DIV_PRESCALER,
cdclk_scale);
+ if (ret) {
+ pr_err("%s: failed to set clock div\n",
+ __func__);
+ return ret;
+ }
}
return 0;