clk: Zero init clk_init_data in helpers
authorManivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Fri, 15 Nov 2019 16:28:55 +0000 (21:58 +0530)
committerStephen Boyd <sboyd@kernel.org>
Fri, 22 Nov 2019 23:58:04 +0000 (15:58 -0800)
The clk_init_data struct needs to be initialized to zero for the new
parent_map implementation to work correctly. Otherwise, the member which
is available first will get processed.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lkml.kernel.org/r/20191115162901.17456-2-manivannan.sadhasivam@linaro.org
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/clk-composite.c
drivers/clk/clk-divider.c
drivers/clk/clk-fixed-rate.c
drivers/clk/clk-gate.c
drivers/clk/clk-mux.c

index 4f13a681ddfcdde9812293496998f20f97b42e79..28aaf4a3b28ab3c07dfd9f48b1056e23d5fa75a4 100644 (file)
@@ -207,7 +207,7 @@ struct clk_hw *clk_hw_register_composite(struct device *dev, const char *name,
                        unsigned long flags)
 {
        struct clk_hw *hw;
-       struct clk_init_data init;
+       struct clk_init_data init = {};
        struct clk_composite *composite;
        struct clk_ops *clk_composite_ops;
        int ret;
index 3f9ff78c4a2a9fe941fcdf8fd87ae113e52921d5..098b2b01f0afc623658388c9f8c9c4417b0cb368 100644 (file)
@@ -471,7 +471,7 @@ static struct clk_hw *_register_divider(struct device *dev, const char *name,
 {
        struct clk_divider *div;
        struct clk_hw *hw;
-       struct clk_init_data init;
+       struct clk_init_data init = {};
        int ret;
 
        if (clk_divider_flags & CLK_DIVIDER_HIWORD_MASK) {
index a7e4aef7a37624a2ce2b4829bf15e4aa7deafead..2c4486c09040e192e35859b20a7c8471983c5bf2 100644 (file)
@@ -58,7 +58,7 @@ struct clk_hw *clk_hw_register_fixed_rate_with_accuracy(struct device *dev,
 {
        struct clk_fixed_rate *fixed;
        struct clk_hw *hw;
-       struct clk_init_data init;
+       struct clk_init_data init = {};
        int ret;
 
        /* allocate fixed-rate clock */
index 1b99fc96274517b61fb0fca61978551e50e837dc..670053c58c1a16dfb065341c30e7ac3e71f5a3a3 100644 (file)
@@ -141,7 +141,7 @@ struct clk_hw *clk_hw_register_gate(struct device *dev, const char *name,
 {
        struct clk_gate *gate;
        struct clk_hw *hw;
-       struct clk_init_data init;
+       struct clk_init_data init = {};
        int ret;
 
        if (clk_gate_flags & CLK_GATE_HIWORD_MASK) {
index 66e91f740508bd3ba996ffe0e67d2c40d55cb869..570b6e5b603bcadc7b5b52e2f5fce2f3a80ac578 100644 (file)
@@ -153,7 +153,7 @@ struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name,
 {
        struct clk_mux *mux;
        struct clk_hw *hw;
-       struct clk_init_data init;
+       struct clk_init_data init = {};
        u8 width = 0;
        int ret;