Skip to content

Commit

Permalink
clk: cache parent clocks only for muxes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rajendra Nayak authored and Mike Turquette committed Jul 11, 2012
1 parent f05259a commit 9ca1c5a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9ca1c5a

Please sign in to comment.