kernel: update 4.1 to 4.1.13
[openwrt/staging/chunkeey.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 --- a/drivers/clk/clk-composite.c
27 +++ b/drivers/clk/clk-composite.c
28 @@ -188,7 +188,7 @@ static void clk_composite_disable(struct
29 }
30
31 struct clk *clk_register_composite(struct device *dev, const char *name,
32 - const char **parent_names, int num_parents,
33 + const char * const *parent_names, int num_parents,
34 struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
35 struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
36 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
37 --- a/drivers/clk/clk-mux.c
38 +++ b/drivers/clk/clk-mux.c
39 @@ -114,7 +114,7 @@ const struct clk_ops clk_mux_ro_ops = {
40 EXPORT_SYMBOL_GPL(clk_mux_ro_ops);
41
42 struct clk *clk_register_mux_table(struct device *dev, const char *name,
43 - const char **parent_names, u8 num_parents, unsigned long flags,
44 + const char * const *parent_names, u8 num_parents, unsigned long flags,
45 void __iomem *reg, u8 shift, u32 mask,
46 u8 clk_mux_flags, u32 *table, spinlock_t *lock)
47 {
48 @@ -166,7 +166,7 @@ struct clk *clk_register_mux_table(struc
49 EXPORT_SYMBOL_GPL(clk_register_mux_table);
50
51 struct clk *clk_register_mux(struct device *dev, const char *name,
52 - const char **parent_names, u8 num_parents, unsigned long flags,
53 + const char * const *parent_names, u8 num_parents, unsigned long flags,
54 void __iomem *reg, u8 shift, u8 width,
55 u8 clk_mux_flags, spinlock_t *lock)
56 {
57 --- a/include/linux/clk-provider.h
58 +++ b/include/linux/clk-provider.h
59 @@ -209,7 +209,7 @@ struct clk_ops {
60 struct clk_init_data {
61 const char *name;
62 const struct clk_ops *ops;
63 - const char **parent_names;
64 + const char * const *parent_names;
65 u8 num_parents;
66 unsigned long flags;
67 };
68 @@ -426,12 +426,12 @@ extern const struct clk_ops clk_mux_ops;
69 extern const struct clk_ops clk_mux_ro_ops;
70
71 struct clk *clk_register_mux(struct device *dev, const char *name,
72 - const char **parent_names, u8 num_parents, unsigned long flags,
73 + const char * const *parent_names, u8 num_parents, unsigned long flags,
74 void __iomem *reg, u8 shift, u8 width,
75 u8 clk_mux_flags, spinlock_t *lock);
76
77 struct clk *clk_register_mux_table(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, u32 mask,
81 u8 clk_mux_flags, u32 *table, spinlock_t *lock);
82
83 @@ -518,7 +518,7 @@ struct clk_composite {
84 };
85
86 struct clk *clk_register_composite(struct device *dev, const char *name,
87 - const char **parent_names, int num_parents,
88 + const char * const *parent_names, int num_parents,
89 struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
90 struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
91 struct clk_hw *gate_hw, const struct clk_ops *gate_ops,