lkml.org 
[lkml]   [2022]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] ASoC: ti: davinci-i2s: Add check for clk_enable()
From


On 28/02/2022 05:15, Jiasheng Jiang wrote:
> As the potential failure of the clk_enable(),
> it should be better to check it and return error
> if fails.

Thank you for the patch!

Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>


>
> Fixes: 5f9a50c3e55e ("ASoC: Davinci: McBSP: add device tree support for McBSP")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> sound/soc/ti/davinci-i2s.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c
> index 6dca51862dd7..0363a088d2e0 100644
> --- a/sound/soc/ti/davinci-i2s.c
> +++ b/sound/soc/ti/davinci-i2s.c
> @@ -708,7 +708,9 @@ static int davinci_i2s_probe(struct platform_device *pdev)
> dev->clk = clk_get(&pdev->dev, NULL);
> if (IS_ERR(dev->clk))
> return -ENODEV;
> - clk_enable(dev->clk);
> + ret = clk_enable(dev->clk);
> + if (ret)
> + goto err_put_clk;
>
> dev->dev = &pdev->dev;
> dev_set_drvdata(&pdev->dev, dev);
> @@ -730,6 +732,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
> snd_soc_unregister_component(&pdev->dev);
> err_release_clk:
> clk_disable(dev->clk);
> +err_put_clk:
> clk_put(dev->clk);
> return ret;
> }

--
Péter

\
 
 \ /
  Last update: 2022-02-28 13:25    [W:0.100 / U:1.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site