[alsa-devel] [PATCH 2/2] ASoC: fsl: imx-sgtl5000: Use devm_clk_get

Nicolin Chen Guangyu.Chen at freescale.com
Thu Jan 30 11:25:40 CET 2014


Hi Philipp,

On Thu, Jan 30, 2014 at 10:47:18AM +0100, Philipp Zabel wrote:
> Use managed devm_clk_get. There is no need to manually
> call clk_put anymore.

http://comments.gmane.org/gmane.linux.alsa.devel/109093
Fabio and Shawn have discussed this before.

Thanks,
Nicolin

---
> 
> Signed-off-by: Philipp Zabel <p.zabel at pengutronix.de>
> ---
>  sound/soc/fsl/imx-sgtl5000.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/sound/soc/fsl/imx-sgtl5000.c b/sound/soc/fsl/imx-sgtl5000.c
> index 3e60b4c..ba2c00b 100644
> --- a/sound/soc/fsl/imx-sgtl5000.c
> +++ b/sound/soc/fsl/imx-sgtl5000.c
> @@ -128,7 +128,7 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
>  		goto fail;
>  	}
>  
> -	data->codec_clk = clk_get(&codec_dev->dev, NULL);
> +	data->codec_clk = devm_clk_get(&codec_dev->dev, NULL);
>  	if (IS_ERR(data->codec_clk)) {
>  		ret = PTR_ERR(data->codec_clk);
>  		goto fail;
> @@ -172,8 +172,6 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
>  	return 0;
>  
>  fail:
> -	if (data && !IS_ERR(data->codec_clk))
> -		clk_put(data->codec_clk);
>  	if (ssi_np)
>  		of_node_put(ssi_np);
>  	if (codec_np)
> @@ -184,10 +182,6 @@ fail:
>  
>  static int imx_sgtl5000_remove(struct platform_device *pdev)
>  {
> -	struct imx_sgtl5000_data *data = platform_get_drvdata(pdev);
> -
> -	clk_put(data->codec_clk);
> -
>  	return 0;
>  }
>  
> -- 
> 1.8.5.3
> 
> 
> 



More information about the Alsa-devel mailing list