]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
clk: Skip fetching index for single parent clocks
authorStephen Boyd <sboyd@codeaurora.org>
Mon, 22 Dec 2014 19:26:42 +0000 (11:26 -0800)
committerMichael Turquette <mturquette@linaro.org>
Tue, 20 Jan 2015 18:09:06 +0000 (10:09 -0800)
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 <sboyd@codeaurora.org>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
drivers/clk/clk.c

index d48ac71c6c8b173793a31e95ebaa93749e883a76..7f25aaf2a2b093720dc8590021ac7b131e7a331c 100644 (file)
@@ -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",