ASoC: samsung: spdif: 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>
This commit is contained in:
Arvind Yadav 2017-07-25 15:44:32 +05:30 committed by Mark Brown
parent f5c97c7b04
commit 0f11daf10b
1 changed files with 6 additions and 2 deletions

View File

@ -391,7 +391,9 @@ static int spdif_probe(struct platform_device *pdev)
ret = -ENOENT; ret = -ENOENT;
goto err0; goto err0;
} }
clk_prepare_enable(spdif->pclk); ret = clk_prepare_enable(spdif->pclk);
if (ret)
goto err0;
spdif->sclk = devm_clk_get(&pdev->dev, "sclk_spdif"); spdif->sclk = devm_clk_get(&pdev->dev, "sclk_spdif");
if (IS_ERR(spdif->sclk)) { if (IS_ERR(spdif->sclk)) {
@ -399,7 +401,9 @@ static int spdif_probe(struct platform_device *pdev)
ret = -ENOENT; ret = -ENOENT;
goto err1; goto err1;
} }
clk_prepare_enable(spdif->sclk); ret = clk_prepare_enable(spdif->sclk);
if (ret)
goto err1;
/* Request S/PDIF Register's memory region */ /* Request S/PDIF Register's memory region */
if (!request_mem_region(mem_res->start, if (!request_mem_region(mem_res->start,