clk: cache parent clocks only for muxes
authorRajendra Nayak <rnayak@ti.com>
Wed, 6 Jun 2012 09:11:30 +0000 (14:41 +0530)
committerMike Turquette <mturquette@linaro.org>
Wed, 11 Jul 2012 22:36:45 +0000 (15:36 -0700)
caching parent clocks makes sense only when a clock has more
than one parent (mux clocks).
Avoid doing this for every other clock.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
[mturquette@linaro.org: removed extra parentheses]
Signed-off-by: Mike Turquette <mturquette@linaro.org>
drivers/clk/clk.c

index 9a1eb0cfa95f3f0a00a7334f3b276bf623d88cf6..46317cbc088f64c92bfd6d3a7dc4efcb10f75c08 100644 (file)
@@ -1235,8 +1235,8 @@ int __clk_init(struct device *dev, struct clk *clk)
         * If clk->parents is not NULL we skip this entire block.  This allows
         * for clock drivers to statically initialize clk->parents.
         */
-       if (clk->num_parents && !clk->parents) {
-               clk->parents = kmalloc((sizeof(struct clk*) * clk->num_parents),
+       if (clk->num_parents > 1 && !clk->parents) {
+               clk->parents = kzalloc((sizeof(struct clk*) * clk->num_parents),
                                GFP_KERNEL);
                /*
                 * __clk_lookup returns NULL for parents that have not been
This page took 0.027902 seconds and 5 git commands to generate.