Skip to content

Commit

Permalink
clk: keystone: gate: fix clk_init_data initialization
Browse files Browse the repository at this point in the history
The clk_init_data struct is allocated in the stack. All members of
this struct should be initialized before using otherwise it will
lead to unpredictable situation as it can contain garbage.

Ultimately the clk->flag field contains garbage. In my case it leads
that flag CLK_IGNORE_UNUSED is set for most of clocks. As result a
bunch of unused clocks cannot be disabled.

So initialize flags in this structure too.

Cc: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
  • Loading branch information
Ivan Khoronzhuk authored and Santosh Shilimkar committed Feb 10, 2014
1 parent 38dbfb5 commit a65e0c6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/clk/keystone/gate.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ static struct clk *clk_register_psc(struct device *dev,

init.name = name;
init.ops = &clk_psc_ops;
init.flags = 0;
init.parent_names = (parent_name ? &parent_name : NULL);
init.num_parents = (parent_name ? 1 : 0);

Expand Down

0 comments on commit a65e0c6

Please sign in to comment.