Commit ed7c9fef authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by Mark Brown

ASoC: ti: davinci-i2s: Add check for clk_enable()

As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.

Fixes: 5f9a50c3 ("ASoC: Davinci: McBSP: add device tree support for McBSP")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: default avatarPeter Ujfalusi <peter.ujfalusi@gmail.com>
Link: https://lore.kernel.org/r/20220228031540.3571959-1-jiasheng@iscas.ac.cnSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent f9482022
...@@ -708,7 +708,9 @@ static int davinci_i2s_probe(struct platform_device *pdev) ...@@ -708,7 +708,9 @@ static int davinci_i2s_probe(struct platform_device *pdev)
dev->clk = clk_get(&pdev->dev, NULL); dev->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(dev->clk)) if (IS_ERR(dev->clk))
return -ENODEV; return -ENODEV;
clk_enable(dev->clk); ret = clk_enable(dev->clk);
if (ret)
goto err_put_clk;
dev->dev = &pdev->dev; dev->dev = &pdev->dev;
dev_set_drvdata(&pdev->dev, dev); dev_set_drvdata(&pdev->dev, dev);
...@@ -730,6 +732,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) ...@@ -730,6 +732,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
err_release_clk: err_release_clk:
clk_disable(dev->clk); clk_disable(dev->clk);
err_put_clk:
clk_put(dev->clk); clk_put(dev->clk);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment