clk: sunxi: factors: Make struct clk_factors_config table const
authorChen-Yu Tsai <wens@csie.org>
Mon, 25 Jan 2016 13:15:38 +0000 (21:15 +0800)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Wed, 27 Jan 2016 15:50:38 +0000 (16:50 +0100)
struct clk_factors_config contains shifts/widths for the factors of
the factors clk. This is used to read out the factors from the register
value. In no case is it written to, so make it const.

Signed-off-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi/clk-factors.c
drivers/clk/sunxi/clk-factors.h
drivers/clk/sunxi/clk-mod0.c
drivers/clk/sunxi/clk-sun9i-core.c
drivers/clk/sunxi/clk-sunxi.c

index 59428dbd607a85d3ff15e3b648f529e1a575abf9..928c079da19366382dbc15caa1fade0137a92f2a 100644 (file)
@@ -48,7 +48,7 @@ static unsigned long clk_factors_recalc_rate(struct clk_hw *hw,
        u32 reg;
        unsigned long rate;
        struct clk_factors *factors = to_clk_factors(hw);
-       struct clk_factors_config *config = factors->config;
+       const struct clk_factors_config *config = factors->config;
 
        /* Fetch the register value */
        reg = readl(factors->reg);
@@ -123,7 +123,7 @@ static int clk_factors_set_rate(struct clk_hw *hw, unsigned long rate,
        u8 n = 0, k = 0, m = 0, p = 0;
        u32 reg;
        struct clk_factors *factors = to_clk_factors(hw);
-       struct clk_factors_config *config = factors->config;
+       const struct clk_factors_config *config = factors->config;
        unsigned long flags = 0;
 
        factors->get_factors((u32 *)&rate, (u32)parent_rate, &n, &k, &m, &p);
index 171085ab5513e4f724017d05d6f91929262a4f78..060319be2b9950a990039d54bb0372e6d29ed0d4 100644 (file)
@@ -23,7 +23,7 @@ struct factors_data {
        int enable;
        int mux;
        int muxmask;
-       struct clk_factors_config *table;
+       const struct clk_factors_config *table;
        void (*getter) (u32 *rate, u32 parent_rate, u8 *n, u8 *k, u8 *m, u8 *p);
        const char *name;
 };
@@ -31,7 +31,7 @@ struct factors_data {
 struct clk_factors {
        struct clk_hw hw;
        void __iomem *reg;
-       struct clk_factors_config *config;
+       const struct clk_factors_config *config;
        void (*get_factors) (u32 *rate, u32 parent, u8 *n, u8 *k, u8 *m, u8 *p);
        spinlock_t *lock;
 };
index d167e1efb92761a0f223a6054787587d58b11152..c67fea1a128d2b1eb6a57a508c327e3e1a07e23a 100644 (file)
@@ -62,7 +62,7 @@ static void sun4i_a10_get_mod0_factors(u32 *freq, u32 parent_rate,
 }
 
 /* user manual says "n" but it's really "p" */
-static struct clk_factors_config sun4i_a10_mod0_config = {
+static const struct clk_factors_config sun4i_a10_mod0_config = {
        .mshift = 0,
        .mwidth = 4,
        .pshift = 16,
index 6c4c98324d3cc6800bace1b4a918707e2b4cc53f..37c85caaef88cd192e5b321b235d90910ff9a9e2 100644 (file)
@@ -71,7 +71,7 @@ static void sun9i_a80_get_pll4_factors(u32 *freq, u32 parent_rate,
        *p_ret = p;
 }
 
-static struct clk_factors_config sun9i_a80_pll4_config = {
+static const struct clk_factors_config sun9i_a80_pll4_config = {
        .mshift = 18,
        .mwidth = 1,
        .nshift = 8,
@@ -134,7 +134,7 @@ static void sun9i_a80_get_gt_factors(u32 *freq, u32 parent_rate,
        *m = div;
 }
 
-static struct clk_factors_config sun9i_a80_gt_config = {
+static const struct clk_factors_config sun9i_a80_gt_config = {
        .mshift = 0,
        .mwidth = 2,
 };
@@ -199,7 +199,7 @@ static void sun9i_a80_get_ahb_factors(u32 *freq, u32 parent_rate,
        *p = _p;
 }
 
-static struct clk_factors_config sun9i_a80_ahb_config = {
+static const struct clk_factors_config sun9i_a80_ahb_config = {
        .pshift = 0,
        .pwidth = 2,
 };
@@ -289,7 +289,7 @@ static void sun9i_a80_get_apb1_factors(u32 *freq, u32 parent_rate,
        *p = calcp;
 }
 
-static struct clk_factors_config sun9i_a80_apb1_config = {
+static const struct clk_factors_config sun9i_a80_apb1_config = {
        .mshift = 0,
        .mwidth = 5,
        .pshift = 16,
index 5ba2188ee99ccaa1f806113073c2e21b17813e5f..3609f080cc9adc1a8724c79436034f5050e4cbab 100644 (file)
@@ -608,7 +608,7 @@ static void sun7i_a20_get_out_factors(u32 *freq, u32 parent_rate,
  * sunxi_factors_clk_setup() - Setup function for factor clocks
  */
 
-static struct clk_factors_config sun4i_pll1_config = {
+static const struct clk_factors_config sun4i_pll1_config = {
        .nshift = 8,
        .nwidth = 5,
        .kshift = 4,
@@ -619,7 +619,7 @@ static struct clk_factors_config sun4i_pll1_config = {
        .pwidth = 2,
 };
 
-static struct clk_factors_config sun6i_a31_pll1_config = {
+static const struct clk_factors_config sun6i_a31_pll1_config = {
        .nshift = 8,
        .nwidth = 5,
        .kshift = 4,
@@ -629,7 +629,7 @@ static struct clk_factors_config sun6i_a31_pll1_config = {
        .n_start = 1,
 };
 
-static struct clk_factors_config sun8i_a23_pll1_config = {
+static const struct clk_factors_config sun8i_a23_pll1_config = {
        .nshift = 8,
        .nwidth = 5,
        .kshift = 4,
@@ -641,14 +641,14 @@ static struct clk_factors_config sun8i_a23_pll1_config = {
        .n_start = 1,
 };
 
-static struct clk_factors_config sun4i_pll5_config = {
+static const struct clk_factors_config sun4i_pll5_config = {
        .nshift = 8,
        .nwidth = 5,
        .kshift = 4,
        .kwidth = 2,
 };
 
-static struct clk_factors_config sun6i_a31_pll6_config = {
+static const struct clk_factors_config sun6i_a31_pll6_config = {
        .nshift = 8,
        .nwidth = 5,
        .kshift = 4,
@@ -656,12 +656,12 @@ static struct clk_factors_config sun6i_a31_pll6_config = {
        .n_start = 1,
 };
 
-static struct clk_factors_config sun5i_a13_ahb_config = {
+static const struct clk_factors_config sun5i_a13_ahb_config = {
        .pshift = 4,
        .pwidth = 2,
 };
 
-static struct clk_factors_config sun4i_apb1_config = {
+static const struct clk_factors_config sun4i_apb1_config = {
        .mshift = 0,
        .mwidth = 5,
        .pshift = 16,
@@ -669,7 +669,7 @@ static struct clk_factors_config sun4i_apb1_config = {
 };
 
 /* user manual says "n" but it's really "p" */
-static struct clk_factors_config sun7i_a20_out_config = {
+static const struct clk_factors_config sun7i_a20_out_config = {
        .mshift = 8,
        .mwidth = 5,
        .pshift = 20,
This page took 0.029947 seconds and 5 git commands to generate.