[PATCH master 1/3] clk: imx: add IMX_COMPOSITE_CLK_FLAGS_DEFAULT macro

Ahmad Fatoum a.fatoum at pengutronix.de
Thu Apr 18 23:10:01 PDT 2024


We use the same flags in two macros and will add one more instance in a
follow-up commit, so factor them out into a macro like Linux does.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/clk/imx/clk.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/imx/clk.h b/drivers/clk/imx/clk.h
index 9058f913d316..00dc72831f38 100644
--- a/drivers/clk/imx/clk.h
+++ b/drivers/clk/imx/clk.h
@@ -276,6 +276,9 @@ struct clk *imx_clk_cpu(const char *name, const char *parent_name,
 #define IMX_COMPOSITE_CORE      BIT(0)
 #define IMX_COMPOSITE_BUS       BIT(1)
 
+#define IMX_COMPOSITE_CLK_FLAGS_DEFAULT \
+	(CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE)
+
 struct clk *imx8m_clk_composite_flags(const char *name,
 		const char * const *parent_names, int num_parents, void __iomem *reg,
 		u32 composite_flags,
@@ -285,13 +288,13 @@ struct clk *imx8m_clk_composite_flags(const char *name,
         imx8m_clk_hw_composite_flags(name, parent_names, \
                         ARRAY_SIZE(parent_names), reg, \
                         IMX_COMPOSITE_CORE, \
-                        CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE)
+                        IMX_COMPOSITE_CLK_FLAGS_DEFAULT)
 
 #define imx8m_clk_hw_composite_bus(name, parent_names, reg)     \
         imx8m_clk_hw_composite_flags(name, parent_names, \
                         ARRAY_SIZE(parent_names), reg, \
                         IMX_COMPOSITE_BUS, \
-                        CLK_SET_RATE_NO_REPARENT | CLK_OPS_PARENT_ENABLE)
+                        IMX_COMPOSITE_CLK_FLAGS_DEFAULT)
 
 #define __imx8m_clk_composite(name, parent_names, reg, flags) \
 		imx8m_clk_composite_flags(name, parent_names, \
-- 
2.39.2




More information about the barebox mailing list