diff options
author | Alex Elder <elder@linaro.org> | 2014-04-21 16:11:40 -0500 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-04-30 11:51:33 -0700 |
commit | b12151ca5cd76e5ed9c75ef02b2f5d2aa5b45808 (patch) | |
tree | 9d652df3ddbffed17b6a7f9145534de7f727b56e /drivers/clk/bcm/clk-kona.c | |
parent | 9d3d87c750f30af0e8e268c122ffec4489bc9638 (diff) | |
download | linux-stable-b12151ca5cd76e5ed9c75ef02b2f5d2aa5b45808.tar.gz linux-stable-b12151ca5cd76e5ed9c75ef02b2f5d2aa5b45808.tar.bz2 linux-stable-b12151ca5cd76e5ed9c75ef02b2f5d2aa5b45808.zip |
clk: bcm281xx: initialize CCU structures statically
We know up front how many CCU's we'll support, so there's no need to
allocate their data structures dynamically. Define a macro
KONA_CCU_COMMON() to simplify the initialization of many of the
fields in a ccu_data structure. Pass the address of a statically
defined CCU structure to kona_dt_ccu_setup() rather than having that
function allocate one.
We also know at build time how many clocks a given CCU will provide,
though the number of of them for each CCU is different. Record the
number of clocks we need in the CCU's clk_onecell_data struct
(which is used when we register the CCU with the common clock code
as a clock provider). Rename that struct field "clk_data" (because
"data" alone gets a little confusing).
Use the known clock count to move the allocation of each CCU's
clocks array into ccu_clks_setup() rather than having each CCU's
setup callback function do it.
(The real motivation behind all of this is that we'll be doing some
static initialization of some additional CCU-specific data soon.)
Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/bcm/clk-kona.c')
-rw-r--r-- | drivers/clk/bcm/clk-kona.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/bcm/clk-kona.c b/drivers/clk/bcm/clk-kona.c index bf0b70e87014..f8bc6bc0784f 100644 --- a/drivers/clk/bcm/clk-kona.c +++ b/drivers/clk/bcm/clk-kona.c @@ -1020,13 +1020,13 @@ bool __init kona_ccu_init(struct ccu_data *ccu) { unsigned long flags; unsigned int which; - struct clk **clks = ccu->data.clks; + struct clk **clks = ccu->clk_data.clks; bool success = true; flags = ccu_lock(ccu); __ccu_write_enable(ccu); - for (which = 0; which < ccu->data.clk_num; which++) { + for (which = 0; which < ccu->clk_data.clk_num; which++) { struct kona_clk *bcm_clk; if (!clks[which]) |