diff options
author | Stephen Boyd <stephen.boyd@linaro.org> | 2016-06-01 19:15:17 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-08-24 20:23:01 -0400 |
commit | 6b212f5a6adc271547279d0140eaf70f8c06e65a (patch) | |
tree | bcedf68adfafb7f6aac7d9de209c9d91425d5f21 | |
parent | 9337631f52a84742a476383eb3e795ac5773f5ab (diff) |
clk: mb86s7x: Migrate to clk_hw based OF and registration APIs
Now that we have clk_hw based provider APIs to register clks, we
can get rid of struct clk pointers while registering clks in
these drivers, allowing us to move closer to a clear split of
consumer and provider clk APIs.
Cc: Jassi Brar <jaswinder.singh@linaro.org>
Signed-off-by: Stephen Boyd <stephen.boyd@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/clk-mb86s7x.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/clk/clk-mb86s7x.c b/drivers/clk/clk-mb86s7x.c index e0817754ca3e..2a83a3ff1d09 100644 --- a/drivers/clk/clk-mb86s7x.c +++ b/drivers/clk/clk-mb86s7x.c | |||
@@ -327,10 +327,11 @@ static struct clk_ops clk_clc_ops = { | |||
327 | .set_rate = clc_set_rate, | 327 | .set_rate = clc_set_rate, |
328 | }; | 328 | }; |
329 | 329 | ||
330 | struct clk *mb86s7x_clclk_register(struct device *cpu_dev) | 330 | static struct clk_hw *mb86s7x_clclk_register(struct device *cpu_dev) |
331 | { | 331 | { |
332 | struct clk_init_data init; | 332 | struct clk_init_data init; |
333 | struct cl_clk *clc; | 333 | struct cl_clk *clc; |
334 | int ret; | ||
334 | 335 | ||
335 | clc = kzalloc(sizeof(*clc), GFP_KERNEL); | 336 | clc = kzalloc(sizeof(*clc), GFP_KERNEL); |
336 | if (!clc) | 337 | if (!clc) |
@@ -344,14 +345,17 @@ struct clk *mb86s7x_clclk_register(struct device *cpu_dev) | |||
344 | init.flags = CLK_GET_RATE_NOCACHE; | 345 | init.flags = CLK_GET_RATE_NOCACHE; |
345 | init.num_parents = 0; | 346 | init.num_parents = 0; |
346 | 347 | ||
347 | return devm_clk_register(cpu_dev, &clc->hw); | 348 | ret = devm_clk_hw_register(cpu_dev, &clc->hw); |
349 | if (ret) | ||
350 | return ERR_PTR(ret); | ||
351 | return &clc->hw; | ||
348 | } | 352 | } |
349 | 353 | ||
350 | static int mb86s7x_clclk_of_init(void) | 354 | static int mb86s7x_clclk_of_init(void) |
351 | { | 355 | { |
352 | int cpu, ret = -ENODEV; | 356 | int cpu, ret = -ENODEV; |
353 | struct device_node *np; | 357 | struct device_node *np; |
354 | struct clk *clk; | 358 | struct clk_hw *hw; |
355 | 359 | ||
356 | np = of_find_compatible_node(NULL, NULL, "fujitsu,mb86s70-scb-1.0"); | 360 | np = of_find_compatible_node(NULL, NULL, "fujitsu,mb86s70-scb-1.0"); |
357 | if (!np || !of_device_is_available(np)) | 361 | if (!np || !of_device_is_available(np)) |
@@ -365,12 +369,12 @@ static int mb86s7x_clclk_of_init(void) | |||
365 | continue; | 369 | continue; |
366 | } | 370 | } |
367 | 371 | ||
368 | clk = mb86s7x_clclk_register(cpu_dev); | 372 | hw = mb86s7x_clclk_register(cpu_dev); |
369 | if (IS_ERR(clk)) { | 373 | if (IS_ERR(hw)) { |
370 | pr_err("failed to register cpu%d clock\n", cpu); | 374 | pr_err("failed to register cpu%d clock\n", cpu); |
371 | continue; | 375 | continue; |
372 | } | 376 | } |
373 | if (clk_register_clkdev(clk, NULL, dev_name(cpu_dev))) { | 377 | if (clk_hw_register_clkdev(hw, NULL, dev_name(cpu_dev))) { |
374 | pr_err("failed to register cpu%d clock lookup\n", cpu); | 378 | pr_err("failed to register cpu%d clock lookup\n", cpu); |
375 | continue; | 379 | continue; |
376 | } | 380 | } |