Merge branch 'akpm' (patches from Andrew)
[firefly-linux-kernel-4.4.55.git] / drivers / clk / clk.c
index 1cf479b9f3b4e8b952f7e5d9b18040963fde7c99..ddb4b541016fe986860a95a4a482d2f6c6713a3e 100644 (file)
@@ -1417,6 +1417,9 @@ static void clk_change_rate(struct clk_core *core)
        if (core->notifier_count && old_rate != core->rate)
                __clk_notify(core, POST_RATE_CHANGE, old_rate, core->rate);
 
+       if (core->flags & CLK_RECALC_NEW_RATES)
+               (void)clk_calc_new_rates(core, core->new_rate);
+
        /*
         * Use safe iteration, as change_rate can actually swap parents
         * for certain clock types.
@@ -1657,6 +1660,14 @@ static void clk_core_reparent(struct clk_core *core,
        __clk_recalc_rates(core, POST_RATE_CHANGE);
 }
 
+void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent)
+{
+       if (!hw)
+               return;
+
+       clk_core_reparent(hw->core, !new_parent ? NULL : new_parent->core);
+}
+
 /**
  * clk_has_parent - check if a clock is a possible parent for another
  * @clk: clock source