aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clk/samsung/clk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/clk/samsung/clk.c')
-rw-r--r--drivers/clk/samsung/clk.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c
index 49629c71c9e7..deab84d9f37d 100644
--- a/drivers/clk/samsung/clk.c
+++ b/drivers/clk/samsung/clk.c
@@ -53,7 +53,6 @@ struct samsung_clk_provider *__init samsung_clk_init(struct device_node *np,
53{ 53{
54 struct samsung_clk_provider *ctx; 54 struct samsung_clk_provider *ctx;
55 struct clk **clk_table; 55 struct clk **clk_table;
56 int ret;
57 int i; 56 int i;
58 57
59 ctx = kzalloc(sizeof(struct samsung_clk_provider), GFP_KERNEL); 58 ctx = kzalloc(sizeof(struct samsung_clk_provider), GFP_KERNEL);
@@ -72,17 +71,19 @@ struct samsung_clk_provider *__init samsung_clk_init(struct device_node *np,
72 ctx->clk_data.clk_num = nr_clks; 71 ctx->clk_data.clk_num = nr_clks;
73 spin_lock_init(&ctx->lock); 72 spin_lock_init(&ctx->lock);
74 73
75 if (!np)
76 return ctx;
77
78 ret = of_clk_add_provider(np, of_clk_src_onecell_get,
79 &ctx->clk_data);
80 if (ret)
81 panic("could not register clock provide\n");
82
83 return ctx; 74 return ctx;
84} 75}
85 76
77void __init samsung_clk_of_add_provider(struct device_node *np,
78 struct samsung_clk_provider *ctx)
79{
80 if (np) {
81 if (of_clk_add_provider(np, of_clk_src_onecell_get,
82 &ctx->clk_data))
83 panic("could not register clk provider\n");
84 }
85}
86
86/* add a clock instance to the clock lookup table used for dt based lookup */ 87/* add a clock instance to the clock lookup table used for dt based lookup */
87void samsung_clk_add_lookup(struct samsung_clk_provider *ctx, struct clk *clk, 88void samsung_clk_add_lookup(struct samsung_clk_provider *ctx, struct clk *clk,
88 unsigned int id) 89 unsigned int id)
@@ -284,7 +285,7 @@ void __init samsung_clk_register_gate(struct samsung_clk_provider *ctx,
284void __init samsung_clk_of_register_fixed_ext(struct samsung_clk_provider *ctx, 285void __init samsung_clk_of_register_fixed_ext(struct samsung_clk_provider *ctx,
285 struct samsung_fixed_rate_clock *fixed_rate_clk, 286 struct samsung_fixed_rate_clock *fixed_rate_clk,
286 unsigned int nr_fixed_rate_clk, 287 unsigned int nr_fixed_rate_clk,
287 struct of_device_id *clk_matches) 288 const struct of_device_id *clk_matches)
288{ 289{
289 const struct of_device_id *match; 290 const struct of_device_id *match;
290 struct device_node *clk_np; 291 struct device_node *clk_np;