diff options
author | Arvind Yadav <arvind.yadav.cs@gmail.com> | 2017-07-25 13:14:30 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-07-26 15:00:24 +0300 |
commit | a7ad9a88300c813a945793e9dae84ceaf7809141 (patch) | |
tree | 1eed9705ebc28f55d044534cc74ab9d873de7ec5 /sound/soc/samsung | |
parent | 8698475a94d0b7eb21efaa346d507dc4932f2032 (diff) | |
download | linux-a7ad9a88300c813a945793e9dae84ceaf7809141.tar.xz |
ASoC: samsung: pcm: 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>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r-- | sound/soc/samsung/pcm.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index d50a6377c23d..37f95eee1558 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c @@ -522,7 +522,9 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to get audio-bus clock\n"); return PTR_ERR(pcm->cclk); } - clk_prepare_enable(pcm->cclk); + ret = clk_prepare_enable(pcm->cclk); + if (ret) + return ret; /* record our pcm structure for later use in the callbacks */ dev_set_drvdata(&pdev->dev, pcm); @@ -533,7 +535,9 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev) ret = PTR_ERR(pcm->pclk); goto err_dis_cclk; } - clk_prepare_enable(pcm->pclk); + ret = clk_prepare_enable(pcm->pclk); + if (ret) + goto err_dis_cclk; s3c_pcm_stereo_in[pdev->id].addr = mem_res->start + S3C_PCM_RXFIFO; s3c_pcm_stereo_out[pdev->id].addr = mem_res->start + S3C_PCM_TXFIFO; |