lkml.org 
[lkml]   [2012]   [Dec]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/4] clk: highbank: Use of_init_clk_data()
Date
Reduce lines of code and simplify this driver by using the
generic clock binding parsing function.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Cc: Rob Herring <rob.herring@calxeda.com>
---
drivers/clk/clk-highbank.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/drivers/clk/clk-highbank.c b/drivers/clk/clk-highbank.c
index 52fecad..5dbbf62 100644
--- a/drivers/clk/clk-highbank.c
+++ b/drivers/clk/clk-highbank.c
@@ -275,8 +275,6 @@ static __init struct clk *hb_clk_init(struct device_node *node, const struct clk
u32 reg;
struct clk *clk;
struct hb_clk *hb_clk;
- const char *clk_name = node->name;
- const char *parent_name;
struct clk_init_data init;
int rc;

@@ -290,24 +288,21 @@ static __init struct clk *hb_clk_init(struct device_node *node, const struct clk

hb_clk->reg = sregs_base + reg;

- of_property_read_string(node, "clock-output-names", &clk_name);
-
- init.name = clk_name;
init.ops = ops;
- init.flags = 0;
- parent_name = of_clk_get_parent_name(node, 0);
- init.parent_names = &parent_name;
- init.num_parents = 1;
+ rc = of_init_clk_data(node, &init);
+ if (WARN_ON(rc))
+ goto err;

hb_clk->hw.init = &init;

clk = clk_register(NULL, &hb_clk->hw);
- if (WARN_ON(IS_ERR(clk))) {
- kfree(hb_clk);
- return NULL;
- }
+ if (WARN_ON(IS_ERR(clk)))
+ goto err;
rc = of_clk_add_provider(node, of_clk_src_simple_get, clk);
return clk;
+err:
+ kfree(hb_clk);
+ return NULL;
}

static void __init hb_pll_init(struct device_node *node)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation


\
 
 \ /
  Last update: 2012-12-17 22:21    [W:0.090 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site