mediatek: add support for the new MT7623 Arm SoC
[openwrt/svn-archive/archive.git] / target / linux / mediatek / patches / 0001-clk-make-strings-in-parent-name-arrays-const.patch
1 From a38e86708141d75c643ffd58865c50a925134e4f Mon Sep 17 00:00:00 2001
2 From: Sascha Hauer <s.hauer@pengutronix.de>
3 Date: Thu, 23 Apr 2015 10:35:38 +0200
4 Subject: [PATCH 01/76] clk: make strings in parent name arrays const
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 The clk functions and structs declare the parent_name arrays as
10 'const char **parent_names' which means the parent name strings
11 are const, but the array itself is not. Use
12 'const char * const * parent_names' instead which also makes
13 the array const. This allows us to put the parent_name arrays into
14 the __initconst section.
15
16 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
17 Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
18 Tested-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
19 Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
20 ---
21 drivers/clk/clk-composite.c | 2 +-
22 drivers/clk/clk-mux.c | 4 ++--
23 include/linux/clk-provider.h | 8 ++++----
24 3 files changed, 7 insertions(+), 7 deletions(-)
25
26 diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
27 index 956b7e5..077f4c7 100644
28 --- a/drivers/clk/clk-composite.c
29 +++ b/drivers/clk/clk-composite.c
30 @@ -188,7 +188,7 @@ static void clk_composite_disable(struct clk_hw *hw)
31 }
32
33 struct clk *clk_register_composite(struct device *dev, const char *name,
34 - const char **parent_names, int num_parents,
35 + const char * const *parent_names, int num_parents,
36 struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
37 struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
38 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
39 diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
40 index 69a094c..1fa2a8d 100644
41 --- a/drivers/clk/clk-mux.c
42 +++ b/drivers/clk/clk-mux.c
43 @@ -114,7 +114,7 @@ const struct clk_ops clk_mux_ro_ops = {
44 EXPORT_SYMBOL_GPL(clk_mux_ro_ops);
45
46 struct clk *clk_register_mux_table(struct device *dev, const char *name,
47 - const char **parent_names, u8 num_parents, unsigned long flags,
48 + const char * const *parent_names, u8 num_parents, unsigned long flags,
49 void __iomem *reg, u8 shift, u32 mask,
50 u8 clk_mux_flags, u32 *table, spinlock_t *lock)
51 {
52 @@ -166,7 +166,7 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name,
53 EXPORT_SYMBOL_GPL(clk_register_mux_table);
54
55 struct clk *clk_register_mux(struct device *dev, const char *name,
56 - const char **parent_names, u8 num_parents, unsigned long flags,
57 + const char * const *parent_names, u8 num_parents, unsigned long flags,
58 void __iomem *reg, u8 shift, u8 width,
59 u8 clk_mux_flags, spinlock_t *lock)
60 {
61 diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
62 index df69531..ec609e5 100644
63 --- a/include/linux/clk-provider.h
64 +++ b/include/linux/clk-provider.h
65 @@ -209,7 +209,7 @@ struct clk_ops {
66 struct clk_init_data {
67 const char *name;
68 const struct clk_ops *ops;
69 - const char **parent_names;
70 + const char * const *parent_names;
71 u8 num_parents;
72 unsigned long flags;
73 };
74 @@ -426,12 +426,12 @@ extern const struct clk_ops clk_mux_ops;
75 extern const struct clk_ops clk_mux_ro_ops;
76
77 struct clk *clk_register_mux(struct device *dev, const char *name,
78 - const char **parent_names, u8 num_parents, unsigned long flags,
79 + const char * const *parent_names, u8 num_parents, unsigned long flags,
80 void __iomem *reg, u8 shift, u8 width,
81 u8 clk_mux_flags, spinlock_t *lock);
82
83 struct clk *clk_register_mux_table(struct device *dev, const char *name,
84 - const char **parent_names, u8 num_parents, unsigned long flags,
85 + const char * const *parent_names, u8 num_parents, unsigned long flags,
86 void __iomem *reg, u8 shift, u32 mask,
87 u8 clk_mux_flags, u32 *table, spinlock_t *lock);
88
89 @@ -518,7 +518,7 @@ struct clk_composite {
90 };
91
92 struct clk *clk_register_composite(struct device *dev, const char *name,
93 - const char **parent_names, int num_parents,
94 + const char * const *parent_names, int num_parents,
95 struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
96 struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
97 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
98 --
99 1.7.10.4
100