aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinh Nguyen <dinguyen@opensource.altera.com>2015-07-06 23:59:06 -0400
committerStephen Boyd <sboyd@codeaurora.org>2015-07-28 14:59:07 -0400
commit9da9e761273702b3afd6e3538c23ece95693e586 (patch)
treedf789e1a1803f80c050746bc5b52175a9e7a03cd
parent8a53fb2bceea00081c4a6af7b477bea8ec00b74b (diff)
clk: ti: make use of of_clk_parent_fill helper function
Use of_clk_parent_fill to fill in the parent clock names' array. Signed-off-by: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Tero Kristo <t-kristo@ti.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r--drivers/clk/ti/apll.c4
-rw-r--r--drivers/clk/ti/composite.c4
-rw-r--r--drivers/clk/ti/dpll.c4
-rw-r--r--drivers/clk/ti/fapll.c3
-rw-r--r--drivers/clk/ti/mux.c4
5 files changed, 5 insertions, 14 deletions
diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c
index 594b759f02ee..de5a02dfd326 100644
--- a/drivers/clk/ti/apll.c
+++ b/drivers/clk/ti/apll.c
@@ -172,7 +172,6 @@ static void __init of_dra7_apll_setup(struct device_node *node)
172 struct clk_hw_omap *clk_hw = NULL; 172 struct clk_hw_omap *clk_hw = NULL;
173 struct clk_init_data *init = NULL; 173 struct clk_init_data *init = NULL;
174 const char **parent_names = NULL; 174 const char **parent_names = NULL;
175 int i;
176 175
177 ad = kzalloc(sizeof(*ad), GFP_KERNEL); 176 ad = kzalloc(sizeof(*ad), GFP_KERNEL);
178 clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL); 177 clk_hw = kzalloc(sizeof(*clk_hw), GFP_KERNEL);
@@ -197,8 +196,7 @@ static void __init of_dra7_apll_setup(struct device_node *node)
197 if (!parent_names) 196 if (!parent_names)
198 goto cleanup; 197 goto cleanup;
199 198
200 for (i = 0; i < init->num_parents; i++) 199 of_clk_parent_fill(node, parent_names, init->num_parents);
201 parent_names[i] = of_clk_get_parent_name(node, i);
202 200
203 init->parent_names = parent_names; 201 init->parent_names = parent_names;
204 202
diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c
index 96f83cedb4b3..dbef218fe5ec 100644
--- a/drivers/clk/ti/composite.c
+++ b/drivers/clk/ti/composite.c
@@ -276,7 +276,6 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
276 int num_parents; 276 int num_parents;
277 const char **parent_names; 277 const char **parent_names;
278 struct component_clk *clk; 278 struct component_clk *clk;
279 int i;
280 279
281 num_parents = of_clk_get_parent_count(node); 280 num_parents = of_clk_get_parent_count(node);
282 281
@@ -289,8 +288,7 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw,
289 if (!parent_names) 288 if (!parent_names)
290 return -ENOMEM; 289 return -ENOMEM;
291 290
292 for (i = 0; i < num_parents; i++) 291 of_clk_parent_fill(node, parent_names, num_parents);
293 parent_names[i] = of_clk_get_parent_name(node, i);
294 292
295 clk = kzalloc(sizeof(*clk), GFP_KERNEL); 293 clk = kzalloc(sizeof(*clk), GFP_KERNEL);
296 if (!clk) { 294 if (!clk) {
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c
index 2aacf7a3bcae..49acdf23ad40 100644
--- a/drivers/clk/ti/dpll.c
+++ b/drivers/clk/ti/dpll.c
@@ -341,7 +341,6 @@ static void __init of_ti_dpll_setup(struct device_node *node,
341 struct clk_init_data *init = NULL; 341 struct clk_init_data *init = NULL;
342 const char **parent_names = NULL; 342 const char **parent_names = NULL;
343 struct dpll_data *dd = NULL; 343 struct dpll_data *dd = NULL;
344 int i;
345 u8 dpll_mode = 0; 344 u8 dpll_mode = 0;
346 345
347 dd = kzalloc(sizeof(*dd), GFP_KERNEL); 346 dd = kzalloc(sizeof(*dd), GFP_KERNEL);
@@ -370,8 +369,7 @@ static void __init of_ti_dpll_setup(struct device_node *node,
370 if (!parent_names) 369 if (!parent_names)
371 goto cleanup; 370 goto cleanup;
372 371
373 for (i = 0; i < init->num_parents; i++) 372 of_clk_parent_fill(node, parent_names, init->num_parents);
374 parent_names[i] = of_clk_get_parent_name(node, i);
375 373
376 init->parent_names = parent_names; 374 init->parent_names = parent_names;
377 375
diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c
index 730aa62454a2..b1c741b11502 100644
--- a/drivers/clk/ti/fapll.c
+++ b/drivers/clk/ti/fapll.c
@@ -558,8 +558,7 @@ static void __init ti_fapll_setup(struct device_node *node)
558 goto free; 558 goto free;
559 } 559 }
560 560
561 parent_name[0] = of_clk_get_parent_name(node, 0); 561 of_clk_parent_fill(node, parent_name, 2);
562 parent_name[1] = of_clk_get_parent_name(node, 1);
563 init->parent_names = parent_name; 562 init->parent_names = parent_name;
564 563
565 fd->clk_ref = of_clk_get(node, 0); 564 fd->clk_ref = of_clk_get(node, 0);
diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c
index 5cdeed538b08..99fe27e8376b 100644
--- a/drivers/clk/ti/mux.c
+++ b/drivers/clk/ti/mux.c
@@ -190,7 +190,6 @@ static void of_mux_clk_setup(struct device_node *node)
190 void __iomem *reg; 190 void __iomem *reg;
191 int num_parents; 191 int num_parents;
192 const char **parent_names; 192 const char **parent_names;
193 int i;
194 u8 clk_mux_flags = 0; 193 u8 clk_mux_flags = 0;
195 u32 mask = 0; 194 u32 mask = 0;
196 u32 shift = 0; 195 u32 shift = 0;
@@ -205,8 +204,7 @@ static void of_mux_clk_setup(struct device_node *node)
205 if (!parent_names) 204 if (!parent_names)
206 goto cleanup; 205 goto cleanup;
207 206
208 for (i = 0; i < num_parents; i++) 207 of_clk_parent_fill(node, parent_names, num_parents);
209 parent_names[i] = of_clk_get_parent_name(node, i);
210 208
211 reg = ti_clk_get_reg_addr(node, 0); 209 reg = ti_clk_get_reg_addr(node, 0);
212 210