diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 459ce9da13e0631b41e6cafc5ed9a85523e5e1b7..5315a273eae9bc1dd4f7922055fc0b10f2b3382a 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2020,6 +2020,14 @@ static void clk_core_reparent(struct clk_core *clk, __clk_recalc_rates(clk, 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 diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index df695313f975769b6cfc740760cbc8c33b6a8d5c..51efb9ec3e37f96f738137e54af0418fd4575e72 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -589,6 +589,7 @@ long __clk_mux_determine_rate_closest(struct clk_hw *hw, unsigned long rate, unsigned long max_rate, unsigned long *best_parent_rate, struct clk_hw **best_parent_p); +void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent); static inline void __clk_hw_set_clk(struct clk_hw *dst, struct clk_hw *src) {