[PATCH 19/24] clk: implement clk_hw_reparent
Ahmad Fatoum
a.fatoum at pengutronix.de
Sun Feb 20 04:47:31 PST 2022
Make porting Linux clock driver code using clk_hw_reparent easier.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
include/linux/clk.h | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/include/linux/clk.h b/include/linux/clk.h
index c0e998e54ae6..1a9c0aa69c43 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -241,6 +241,14 @@ int clk_hw_set_rate(struct clk_hw *hw, unsigned long rate);
int clk_set_parent(struct clk *clk, struct clk *parent);
int clk_hw_set_parent(struct clk_hw *hw, struct clk_hw *hwp);
+static inline void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent)
+{
+ if (!hw)
+ return;
+
+ clk_hw_set_parent(hw, new_parent);
+}
+
/**
* clk_get_parent - get the parent clock source for this clock
* @clk: clock source
--
2.30.2
More information about the barebox
mailing list