OSDN Git Service

clk: bcm281xx: initialize CCU structures statically
authorAlex Elder <elder@linaro.org>
Mon, 21 Apr 2014 21:11:40 +0000 (16:11 -0500)
committerMike Turquette <mturquette@linaro.org>
Wed, 30 Apr 2014 18:51:33 +0000 (11:51 -0700)
commitb12151ca5cd76e5ed9c75ef02b2f5d2aa5b45808
tree9d652df3ddbffed17b6a7f9145534de7f727b56e
parent9d3d87c750f30af0e8e268c122ffec4489bc9638
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>
drivers/clk/bcm/clk-bcm281xx.c
drivers/clk/bcm/clk-kona-setup.c
drivers/clk/bcm/clk-kona.c
drivers/clk/bcm/clk-kona.h