]> git.baikalelectronics.ru Git - kernel.git/commit
clk: Allow late cache allocation for clk->parents
authorRajendra Nayak <rnayak@ti.com>
Wed, 6 Jun 2012 09:11:31 +0000 (14:41 +0530)
committerMike Turquette <mturquette@linaro.org>
Mon, 25 Jun 2012 23:51:47 +0000 (16:51 -0700)
commit173a1b3812543c49a6ae269f9e73945631e483c6
tree076b85e7b2a9e6fd1f24416e54566cd63b7d336b
parent6e44db983754c9c4f240e8dbba8406f720fe8eef
clk: Allow late cache allocation for clk->parents

Parent clocks for muxes are cached in clk->parents to
avoid frequent lookups, however the cache allocation happens
only during clock registeration and later clk_set_parent()
assumes a cache space available and allocated.

This is not entirely true for platforms which do early clock
registerations wherein the cache allocation using kzalloc
could fail during clock registeration.

Allow cache allocation to happen later as part of clk_set_parent()
to help such cases and avoid crashes assuming a cache being
available.

While here also replace existing kmalloc() with kzalloc()
in the file.

Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Cc: stable@kernel.org
drivers/clk/clk.c