lkml.org 
[lkml]   [2015]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH/RFC 5/6] staging: board: Add support for devices with complex dependencies
On Fri, Apr 03, 2015 at 02:42:02PM +0200, Geert Uytterhoeven wrote:
> +int __init board_staging_register_clock(const struct board_staging_clk *bsc)
> +{
> + struct clk *clk;
> + int error;
> +
> + pr_debug("Registering clock %s for con_id %s dev_id %s\n", bsc->clk,
> + bsc->con_id, bsc->dev_id);
> + clk = clk_get(NULL, bsc->clk);
> + if (IS_ERR(clk)) {
> + error = PTR_ERR(clk);
> + pr_err("Failed to get clock %s (%d)\n", bsc->clk, error);
> + return error;
> + }
> +
> + error = clk_register_clkdev(clk, bsc->con_id, bsc->dev_id);
> + if (error)
> + pr_err("Failed to register clock %s (%d)\n", bsc->clk, error);
> + return error;

Missing curly braces. Also it's weird that don't we need a clk_put()
on the error patch as well as the success path?

> +
> + clk_put(clk);
> + return 0;
> +}


regards,
dan carpenter


\
 
 \ /
  Last update: 2015-04-03 15:41    [W:9.278 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site