diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-07-25 06:14:29 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-07-26 08:00:18 -0400 |
commit | 8698475a94d0b7eb21efaa346d507dc4932f2032 (patch) | |
tree | 9e733b816c93194ea1bf770693d13d8fa0e6d96e | |
parent | d2d2c0a0f0e230e9650e778d0d5c7ed6d1bcffb0 (diff) |
ASoC: samsung: s3c24xx: Handle return value of clk_prepare_enable.
clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/samsung/s3c24xx-i2s.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index 91e6871e5413..8d58d02183bf 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c | |||
@@ -340,6 +340,7 @@ EXPORT_SYMBOL_GPL(s3c24xx_i2s_get_clockrate); | |||
340 | 340 | ||
341 | static int s3c24xx_i2s_probe(struct snd_soc_dai *dai) | 341 | static int s3c24xx_i2s_probe(struct snd_soc_dai *dai) |
342 | { | 342 | { |
343 | int ret; | ||
343 | snd_soc_dai_init_dma_data(dai, &s3c24xx_i2s_pcm_stereo_out, | 344 | snd_soc_dai_init_dma_data(dai, &s3c24xx_i2s_pcm_stereo_out, |
344 | &s3c24xx_i2s_pcm_stereo_in); | 345 | &s3c24xx_i2s_pcm_stereo_in); |
345 | 346 | ||
@@ -348,7 +349,9 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai) | |||
348 | pr_err("failed to get iis_clock\n"); | 349 | pr_err("failed to get iis_clock\n"); |
349 | return PTR_ERR(s3c24xx_i2s.iis_clk); | 350 | return PTR_ERR(s3c24xx_i2s.iis_clk); |
350 | } | 351 | } |
351 | clk_prepare_enable(s3c24xx_i2s.iis_clk); | 352 | ret = clk_prepare_enable(s3c24xx_i2s.iis_clk); |
353 | if (ret) | ||
354 | return ret; | ||
352 | 355 | ||
353 | /* Configure the I2S pins (GPE0...GPE4) in correct mode */ | 356 | /* Configure the I2S pins (GPE0...GPE4) in correct mode */ |
354 | s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), | 357 | s3c_gpio_cfgall_range(S3C2410_GPE(0), 5, S3C_GPIO_SFN(2), |
@@ -377,7 +380,11 @@ static int s3c24xx_i2s_suspend(struct snd_soc_dai *cpu_dai) | |||
377 | 380 | ||
378 | static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai) | 381 | static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai) |
379 | { | 382 | { |
380 | clk_prepare_enable(s3c24xx_i2s.iis_clk); | 383 | int ret; |
384 | |||
385 | ret = clk_prepare_enable(s3c24xx_i2s.iis_clk); | ||
386 | if (ret) | ||
387 | return ret; | ||
381 | 388 | ||
382 | writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); | 389 | writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON); |
383 | writel(s3c24xx_i2s.iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); | 390 | writel(s3c24xx_i2s.iismod, s3c24xx_i2s.regs + S3C2410_IISMOD); |