Merge tag 'cve-2020-11884' from emailed bundle
[linux-2.6-microblaze.git] / drivers / clk / sprd / mux.h
index 892e419..f3cc31d 100644 (file)
@@ -36,26 +36,40 @@ struct sprd_mux {
                .table  = _table,                       \
        }
 
-#define SPRD_MUX_CLK_TABLE(_struct, _name, _parents, _table,           \
-                                    _reg, _shift, _width,              \
-                                    _flags)                            \
+#define SPRD_MUX_CLK_HW_INIT_FN(_struct, _name, _parents, _table,      \
+                               _reg, _shift, _width, _flags, _fn)      \
        struct sprd_mux _struct = {                                     \
                .mux    = _SPRD_MUX_CLK(_shift, _width, _table),        \
                .common = {                                             \
                        .regmap         = NULL,                         \
                        .reg            = _reg,                         \
-                       .hw.init = CLK_HW_INIT_PARENTS(_name,           \
-                                                      _parents,        \
-                                                      &sprd_mux_ops,   \
-                                                      _flags),         \
+                       .hw.init = _fn(_name, _parents,                 \
+                                      &sprd_mux_ops, _flags),          \
                }                                                       \
        }
 
+#define SPRD_MUX_CLK_TABLE(_struct, _name, _parents, _table,           \
+                          _reg, _shift, _width, _flags)                \
+       SPRD_MUX_CLK_HW_INIT_FN(_struct, _name, _parents, _table,       \
+                               _reg, _shift, _width, _flags,           \
+                               CLK_HW_INIT_PARENTS)
+
 #define SPRD_MUX_CLK(_struct, _name, _parents, _reg,           \
                     _shift, _width, _flags)                    \
        SPRD_MUX_CLK_TABLE(_struct, _name, _parents, NULL,      \
                           _reg, _shift, _width, _flags)
 
+#define SPRD_MUX_CLK_DATA_TABLE(_struct, _name, _parents, _table,      \
+                               _reg, _shift, _width, _flags)           \
+       SPRD_MUX_CLK_HW_INIT_FN(_struct, _name, _parents, _table,       \
+                               _reg, _shift, _width, _flags,           \
+                               CLK_HW_INIT_PARENTS_DATA)
+
+#define SPRD_MUX_CLK_DATA(_struct, _name, _parents, _reg,              \
+                         _shift, _width, _flags)                       \
+       SPRD_MUX_CLK_DATA_TABLE(_struct, _name, _parents, NULL,         \
+                               _reg, _shift, _width, _flags)
+
 static inline struct sprd_mux *hw_to_sprd_mux(const struct clk_hw *hw)
 {
        struct sprd_clk_common *common = hw_to_sprd_clk_common(hw);