2
0

0001-clk-make-strings-in-parent-name-arrays-const.patch 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. From a38e86708141d75c643ffd58865c50a925134e4f Mon Sep 17 00:00:00 2001
  2. From: Sascha Hauer <[email protected]>
  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. The clk functions and structs declare the parent_name arrays as
  9. 'const char **parent_names' which means the parent name strings
  10. are const, but the array itself is not. Use
  11. 'const char * const * parent_names' instead which also makes
  12. the array const. This allows us to put the parent_name arrays into
  13. the __initconst section.
  14. Signed-off-by: Sascha Hauer <[email protected]>
  15. Reviewed-by: Krzysztof Kozlowski <[email protected]>
  16. Tested-by: Krzysztof Kozlowski <[email protected]>
  17. Acked-by: Uwe Kleine-König <[email protected]>
  18. ---
  19. drivers/clk/clk-composite.c | 2 +-
  20. drivers/clk/clk-mux.c | 4 ++--
  21. include/linux/clk-provider.h | 8 ++++----
  22. 3 files changed, 7 insertions(+), 7 deletions(-)
  23. --- a/drivers/clk/clk-composite.c
  24. +++ b/drivers/clk/clk-composite.c
  25. @@ -188,7 +188,7 @@ static void clk_composite_disable(struct
  26. }
  27. struct clk *clk_register_composite(struct device *dev, const char *name,
  28. - const char **parent_names, int num_parents,
  29. + const char * const *parent_names, int num_parents,
  30. struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
  31. struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
  32. struct clk_hw *gate_hw, const struct clk_ops *gate_ops,
  33. --- a/drivers/clk/clk-mux.c
  34. +++ b/drivers/clk/clk-mux.c
  35. @@ -114,7 +114,7 @@ const struct clk_ops clk_mux_ro_ops = {
  36. EXPORT_SYMBOL_GPL(clk_mux_ro_ops);
  37. struct clk *clk_register_mux_table(struct device *dev, const char *name,
  38. - const char **parent_names, u8 num_parents, unsigned long flags,
  39. + const char * const *parent_names, u8 num_parents, unsigned long flags,
  40. void __iomem *reg, u8 shift, u32 mask,
  41. u8 clk_mux_flags, u32 *table, spinlock_t *lock)
  42. {
  43. @@ -166,7 +166,7 @@ struct clk *clk_register_mux_table(struc
  44. EXPORT_SYMBOL_GPL(clk_register_mux_table);
  45. struct clk *clk_register_mux(struct device *dev, const char *name,
  46. - const char **parent_names, u8 num_parents, unsigned long flags,
  47. + const char * const *parent_names, u8 num_parents, unsigned long flags,
  48. void __iomem *reg, u8 shift, u8 width,
  49. u8 clk_mux_flags, spinlock_t *lock)
  50. {
  51. --- a/include/linux/clk-provider.h
  52. +++ b/include/linux/clk-provider.h
  53. @@ -209,7 +209,7 @@ struct clk_ops {
  54. struct clk_init_data {
  55. const char *name;
  56. const struct clk_ops *ops;
  57. - const char **parent_names;
  58. + const char * const *parent_names;
  59. u8 num_parents;
  60. unsigned long flags;
  61. };
  62. @@ -426,12 +426,12 @@ extern const struct clk_ops clk_mux_ops;
  63. extern const struct clk_ops clk_mux_ro_ops;
  64. struct clk *clk_register_mux(struct device *dev, const char *name,
  65. - const char **parent_names, u8 num_parents, unsigned long flags,
  66. + const char * const *parent_names, u8 num_parents, unsigned long flags,
  67. void __iomem *reg, u8 shift, u8 width,
  68. u8 clk_mux_flags, spinlock_t *lock);
  69. struct clk *clk_register_mux_table(struct device *dev, const char *name,
  70. - const char **parent_names, u8 num_parents, unsigned long flags,
  71. + const char * const *parent_names, u8 num_parents, unsigned long flags,
  72. void __iomem *reg, u8 shift, u32 mask,
  73. u8 clk_mux_flags, u32 *table, spinlock_t *lock);
  74. @@ -518,7 +518,7 @@ struct clk_composite {
  75. };
  76. struct clk *clk_register_composite(struct device *dev, const char *name,
  77. - const char **parent_names, int num_parents,
  78. + const char * const *parent_names, int num_parents,
  79. struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
  80. struct clk_hw *rate_hw, const struct clk_ops *rate_ops,
  81. struct clk_hw *gate_hw, const struct clk_ops *gate_ops,