summaryrefslogtreecommitdiff
path: root/drivers/clk
diff options
context:
space:
mode:
authorRajendra Nayak <rnayak@ti.com>2012-06-06 14:41:30 +0530
committerMike Turquette <mturquette@linaro.org>2012-07-11 15:36:45 -0700
commit9ca1c5a4bf4105d6f2f2a46892495953dd3e2fec (patch)
tree8aae4e19948d34c24935ffc429a58a95e5e85379 /drivers/clk
parentf05259a6ffa40097b5565f25c3fcf833a9d3ecf5 (diff)
downloadlinux-3.10-9ca1c5a4bf4105d6f2f2a46892495953dd3e2fec.tar.gz
linux-3.10-9ca1c5a4bf4105d6f2f2a46892495953dd3e2fec.tar.bz2
linux-3.10-9ca1c5a4bf4105d6f2f2a46892495953dd3e2fec.zip
clk: cache parent clocks only for muxes
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>
Diffstat (limited to 'drivers/clk')
-rw-r--r--drivers/clk/clk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 9a1eb0cfa95..46317cbc088 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -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