• Rajendra Nayak's avatar
    clk: Allow late cache allocation for clk->parents · 7975059d
    Rajendra Nayak authored
    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: default avatarRajendra Nayak <rnayak@ti.com>
    Signed-off-by: default avatarMike Turquette <mturquette@linaro.org>
    Cc: stable@kernel.org
    7975059d
clk.c 37.7 KB