Merge branch 'clk-fixes' into clk-next
authorStephen Boyd <sboyd@codeaurora.org>
Thu, 17 Sep 2015 19:28:41 +0000 (12:28 -0700)
committerStephen Boyd <sboyd@codeaurora.org>
Thu, 17 Sep 2015 19:28:41 +0000 (12:28 -0700)
* clk-fixes:
  drivers: clk: st: Rename st_pll3200c32_407_c0_x into st_pll3200c32_cx_x
  clk: check for invalid parent index of orphans in __clk_init()

1  2 
drivers/clk/clk.c

diff --combined drivers/clk/clk.c
@@@ -1685,7 -1685,7 +1685,7 @@@ static struct clk_core *__clk_init_pare
                        "%s: multi-parent clocks must implement .get_parent\n",
                        __func__);
                goto out;
 -      };
 +      }
  
        /*
         * Do our best to cache parent clocks in core->parents.  This prevents
@@@ -2437,7 -2437,8 +2437,8 @@@ static int __clk_init(struct device *de
        hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) {
                if (orphan->num_parents && orphan->ops->get_parent) {
                        i = orphan->ops->get_parent(orphan->hw);
-                       if (!strcmp(core->name, orphan->parent_names[i]))
+                       if (i >= 0 && i < orphan->num_parents &&
+                           !strcmp(core->name, orphan->parent_names[i]))
                                clk_core_reparent(orphan, core);
                        continue;
                }