clk: sunxi: Make clocks setup functions take const pointer
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Tue, 2 Feb 2016 08:47:11 +0000 (09:47 +0100)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Thu, 11 Feb 2016 17:17:04 +0000 (18:17 +0100)
All the data structure that we pass to the clocks setup functions are
declared const, while our setup functions expects a regular pointer. This
was hidden by the fact that we cast a void * pointer back to these
structures, which made it go unnoticed.

Fix the functions prototype.

Acked-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
drivers/clk/sunxi/clk-sunxi.c

index f777b4f8294adc4d7e613aff6256900c3a56ef2b..77d91e3cd6ce328064b1db70efec431b2b797894 100644 (file)
@@ -616,7 +616,7 @@ static const struct mux_data sun8i_h3_ahb2_mux_data __initconst = {
 };
 
 static struct clk * __init sunxi_mux_clk_setup(struct device_node *node,
-                                              struct mux_data *data)
+                                              const struct mux_data *data)
 {
        struct clk *clk;
        const char *clk_name = node->name;
@@ -712,7 +712,7 @@ static const struct div_data sun4i_apb0_data __initconst = {
 };
 
 static void __init sunxi_divider_clk_setup(struct device_node *node,
-                                          struct div_data *data)
+                                          const struct div_data *data)
 {
        struct clk *clk;
        const char *clk_name = node->name;
@@ -823,7 +823,7 @@ static const struct divs_data sun6i_a31_pll6_divs_data __initconst = {
  */
 
 static struct clk ** __init sunxi_divs_clk_setup(struct device_node *node,
-                                                struct divs_data *data)
+                                                const struct divs_data *data)
 {
        struct clk_onecell_data *clk_data;
        const char *parent;