]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
clk: keystone: gate: fix clk_init_data initialization
authorIvan Khoronzhuk <ivan.khoronzhuk@ti.com>
Tue, 28 Jan 2014 10:49:15 +0000 (12:49 +0200)
committerSantosh Shilimkar <santosh.shilimkar@ti.com>
Mon, 10 Feb 2014 20:17:43 +0000 (15:17 -0500)
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>
drivers/clk/keystone/gate.c

index 17a598398a53df461e110ca5c16d29e7bc92e6f5..86f1e362eafb8e29c02fae393620d39d32278529 100644 (file)
@@ -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);