From: Stephen Boyd Date: Mon, 22 Dec 2014 19:26:42 +0000 (-0800) Subject: clk: Skip fetching index for single parent clocks X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4526e7b857076ba613cc7199fc7fd17d60e86ede;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git clk: Skip fetching index for single parent clocks We don't need to fetch the parent index for clocks if they only have one parent. Doing this also avoid an unnecessary allocation for the parent cache. Signed-off-by: Stephen Boyd Signed-off-by: Michael Turquette --- diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index d48ac71c6c8b..7f25aaf2a2b0 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -1390,7 +1390,7 @@ static struct clk *clk_calc_new_rates(struct clk *clk, unsigned long rate) } /* try finding the new parent index */ - if (parent) { + if (parent && clk->num_parents > 1) { p_index = clk_fetch_parent_index(clk, parent); if (p_index < 0) { pr_debug("%s: clk %s can not be parent of clk %s\n",