OSDN Git Service

clk: mediatek: Add __initdata and __init for data and functions
authorJames Liao <jamesjj.liao@mediatek.com>
Tue, 28 Jul 2015 07:37:34 +0000 (15:37 +0800)
committerJames Liao <jamesjj.liao@mediatek.com>
Thu, 1 Oct 2015 04:04:49 +0000 (12:04 +0800)
Add __init for clock registration functions, and add __initdata for
mtk_gate_regs initial structures.

Signed-off-by: James Liao <jamesjj.liao@mediatek.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
drivers/clk/mediatek/clk-gate.c
drivers/clk/mediatek/clk-mt8173.c
drivers/clk/mediatek/clk-mtk.c

index 5702036..576bdb7 100644 (file)
@@ -97,7 +97,7 @@ const struct clk_ops mtk_clk_gate_ops_setclr_inv = {
        .disable        = mtk_cg_disable_inv,
 };
 
-struct clk *mtk_clk_register_gate(
+struct clk * __init mtk_clk_register_gate(
                const char *name,
                const char *parent_name,
                struct regmap *regmap,
index 63e32fd..849507a 100644 (file)
@@ -587,7 +587,7 @@ static const struct mtk_composite top_muxes[] __initconst = {
        MUX(CLK_TOP_I2S3_B_SEL, "i2s3_b_ck_sel", i2s3_b_ck_parents, 0x120, 8, 1),
 };
 
-static const struct mtk_gate_regs infra_cg_regs = {
+static const struct mtk_gate_regs infra_cg_regs __initconst = {
        .set_ofs = 0x0040,
        .clr_ofs = 0x0044,
        .sta_ofs = 0x0048,
@@ -620,13 +620,13 @@ static const struct mtk_fixed_factor infra_divs[] __initconst = {
        FACTOR(CLK_INFRA_CLK_13M, "clk13m", "clk26m", 1, 2),
 };
 
-static const struct mtk_gate_regs peri0_cg_regs = {
+static const struct mtk_gate_regs peri0_cg_regs __initconst = {
        .set_ofs = 0x0008,
        .clr_ofs = 0x0010,
        .sta_ofs = 0x0018,
 };
 
-static const struct mtk_gate_regs peri1_cg_regs = {
+static const struct mtk_gate_regs peri1_cg_regs __initconst = {
        .set_ofs = 0x000c,
        .clr_ofs = 0x0014,
        .sta_ofs = 0x001c,
index 18444ae..268b6ff 100644 (file)
@@ -24,7 +24,7 @@
 #include "clk-mtk.h"
 #include "clk-gate.h"
 
-struct clk_onecell_data *mtk_alloc_clk_data(unsigned int clk_num)
+struct clk_onecell_data * __init mtk_alloc_clk_data(unsigned int clk_num)
 {
        int i;
        struct clk_onecell_data *clk_data;
@@ -49,8 +49,8 @@ err_out:
        return NULL;
 }
 
-void mtk_clk_register_factors(const struct mtk_fixed_factor *clks, int num,
-               struct clk_onecell_data *clk_data)
+void __init mtk_clk_register_factors(const struct mtk_fixed_factor *clks,
+               int num, struct clk_onecell_data *clk_data)
 {
        int i;
        struct clk *clk;
@@ -72,7 +72,8 @@ void mtk_clk_register_factors(const struct mtk_fixed_factor *clks, int num,
        }
 }
 
-int mtk_clk_register_gates(struct device_node *node, const struct mtk_gate *clks,
+int __init mtk_clk_register_gates(struct device_node *node,
+               const struct mtk_gate *clks,
                int num, struct clk_onecell_data *clk_data)
 {
        int i;
@@ -111,7 +112,7 @@ int mtk_clk_register_gates(struct device_node *node, const struct mtk_gate *clks
        return 0;
 }
 
-struct clk *mtk_clk_register_composite(const struct mtk_composite *mc,
+struct clk * __init mtk_clk_register_composite(const struct mtk_composite *mc,
                void __iomem *base, spinlock_t *lock)
 {
        struct clk *clk;
@@ -196,7 +197,7 @@ err_out:
        return ERR_PTR(ret);
 }
 
-void mtk_clk_register_composites(const struct mtk_composite *mcs,
+void __init mtk_clk_register_composites(const struct mtk_composite *mcs,
                int num, void __iomem *base, spinlock_t *lock,
                struct clk_onecell_data *clk_data)
 {