ASoC: samsung: s3c24xx: Handle return value of clk_prepare_enable.
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Tue, 25 Jul 2017 10:14:29 +0000 (15:44 +0530)
committerMark Brown <broonie@kernel.org>
Wed, 26 Jul 2017 12:00:18 +0000 (13:00 +0100)
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>
sound/soc/samsung/s3c24xx-i2s.c

index 91e6871e5413a64898e33339d41903d15cba7f41..8d58d02183bf5bd57c4143483cff54f08db6c97a 100644 (file)
@@ -340,6 +340,7 @@ EXPORT_SYMBOL_GPL(s3c24xx_i2s_get_clockrate);
 
 static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
 {
+       int ret;
        snd_soc_dai_init_dma_data(dai, &s3c24xx_i2s_pcm_stereo_out,
                                        &s3c24xx_i2s_pcm_stereo_in);
 
@@ -348,7 +349,9 @@ static int s3c24xx_i2s_probe(struct snd_soc_dai *dai)
                pr_err("failed to get iis_clock\n");
                return PTR_ERR(s3c24xx_i2s.iis_clk);
        }
-       clk_prepare_enable(s3c24xx_i2s.iis_clk);
+       ret = clk_prepare_enable(s3c24xx_i2s.iis_clk);
+       if (ret)
+               return ret;
 
        /* Configure the I2S pins (GPE0...GPE4) in correct mode */
        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)
 
 static int s3c24xx_i2s_resume(struct snd_soc_dai *cpu_dai)
 {
-       clk_prepare_enable(s3c24xx_i2s.iis_clk);
+       int ret;
+
+       ret = clk_prepare_enable(s3c24xx_i2s.iis_clk);
+       if (ret)
+               return ret;
 
        writel(s3c24xx_i2s.iiscon, s3c24xx_i2s.regs + S3C2410_IISCON);
        writel(s3c24xx_i2s.iismod, s3c24xx_i2s.regs + S3C2410_IISMOD);