Re: [PATCH] omapdss: use devm_clk_get()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2013-04-08 11:55, Archit Taneja wrote:
> Use devm_clk_get() instead of clk_get() for dss, and for outputs hdmi and venc.
> This reduces reduces code and simplifies error handling.
> 
> Signed-off-by: Archit Taneja <archit@xxxxxx>
> ---
>  drivers/video/omap2/dss/dss.c  |   18 +++---------------
>  drivers/video/omap2/dss/hdmi.c |   16 ++--------------
>  drivers/video/omap2/dss/venc.c |   10 +---------
>  3 files changed, 6 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
> index 054c2a2..645b3bc 100644
> --- a/drivers/video/omap2/dss/dss.c
> +++ b/drivers/video/omap2/dss/dss.c
> @@ -767,13 +767,11 @@ int dss_dpi_select_source(enum omap_channel channel)
>  static int dss_get_clocks(void)
>  {
>  	struct clk *clk;
> -	int r;
>  
> -	clk = clk_get(&dss.pdev->dev, "fck");
> +	clk = devm_clk_get(&dss.pdev->dev, "fck");
>  	if (IS_ERR(clk)) {
>  		DSSERR("can't get clock fck\n");
> -		r = PTR_ERR(clk);
> -		goto err;
> +		return PTR_ERR(clk);
>  	}
>  
>  	dss.dss_clk = clk;
> @@ -782,8 +780,7 @@ static int dss_get_clocks(void)
>  		clk = clk_get(NULL, dss.feat->clk_name);
>  		if (IS_ERR(clk)) {
>  			DSSERR("Failed to get %s\n", dss.feat->clk_name);
> -			r = PTR_ERR(clk);
> -			goto err;
> +			return PTR_ERR(clk);
>  		}
>  	} else {
>  		clk = NULL;
> @@ -792,21 +789,12 @@ static int dss_get_clocks(void)
>  	dss.dpll4_m4_ck = clk;
>  
>  	return 0;
> -
> -err:
> -	if (dss.dss_clk)
> -		clk_put(dss.dss_clk);
> -	if (dss.dpll4_m4_ck)
> -		clk_put(dss.dpll4_m4_ck);
> -
> -	return r;
>  }

Why didn't you use devm_clk_get for the dpll4_m4_ck clock also?

 Tomi


Attachment: signature.asc
Description: OpenPGP digital signature


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux