aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/clk/clk-composite.c2
-rw-r--r--drivers/clk/clk-divider.c2
-rw-r--r--drivers/clk/clk-fixed-factor.c2
-rw-r--r--drivers/clk/clk-fixed-rate.c2
-rw-r--r--drivers/clk/clk-fractional-divider.c2
-rw-r--r--drivers/clk/clk-gate.c2
-rw-r--r--drivers/clk/clk-gpio.c2
-rw-r--r--drivers/clk/clk-multiplier.c2
-rw-r--r--drivers/clk/clk-mux.c2
-rw-r--r--drivers/clk/imx/clk-busy.c4
-rw-r--r--drivers/clk/imx/clk-fixup-div.c5
-rw-r--r--drivers/clk/imx/clk-fixup-mux.c2
-rw-r--r--drivers/clk/imx/clk-gate-exclusive.c2
-rw-r--r--drivers/clk/mediatek/clk-gate.c8
-rw-r--r--drivers/clk/mediatek/clk-gate.h2
-rw-r--r--drivers/clk/mvebu/common.c2
-rw-r--r--drivers/clk/mvebu/kirkwood.c2
-rw-r--r--drivers/clk/mxs/clk-div.c2
-rw-r--r--drivers/clk/nxp/clk-lpc18xx-ccu.c2
-rw-r--r--drivers/clk/st/clkgen-mux.c9
-rw-r--r--drivers/clk/ti/composite.c2
-rw-r--r--drivers/clk/ti/divider.c2
-rw-r--r--drivers/clk/ti/gate.c2
-rw-r--r--drivers/clk/ti/mux.c2
-rw-r--r--include/linux/clk-provider.h18
25 files changed, 33 insertions, 51 deletions
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 4735de0660cc..1f903e1f86a2 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -19,8 +19,6 @@
19#include <linux/err.h> 19#include <linux/err.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21 21
22#define to_clk_composite(_hw) container_of(_hw, struct clk_composite, hw)
23
24static u8 clk_composite_get_parent(struct clk_hw *hw) 22static u8 clk_composite_get_parent(struct clk_hw *hw)
25{ 23{
26 struct clk_composite *composite = to_clk_composite(hw); 24 struct clk_composite *composite = to_clk_composite(hw);
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index aa1dacdaa39d..7d62dc30e969 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -28,8 +28,6 @@
28 * parent - fixed parent. No clk_set_parent support 28 * parent - fixed parent. No clk_set_parent support
29 */ 29 */
30 30
31#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
32
33#define div_mask(width) ((1 << (width)) - 1) 31#define div_mask(width) ((1 << (width)) - 1)
34 32
35static unsigned int _get_table_maxdiv(const struct clk_div_table *table, 33static unsigned int _get_table_maxdiv(const struct clk_div_table *table,
diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index 83de57aeceea..f0ddf37d5e15 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -23,8 +23,6 @@
23 * parent - fixed parent. No clk_set_parent support 23 * parent - fixed parent. No clk_set_parent support
24 */ 24 */
25 25
26#define to_clk_fixed_factor(_hw) container_of(_hw, struct clk_fixed_factor, hw)
27
28static unsigned long clk_factor_recalc_rate(struct clk_hw *hw, 26static unsigned long clk_factor_recalc_rate(struct clk_hw *hw,
29 unsigned long parent_rate) 27 unsigned long parent_rate)
30{ 28{
diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c
index f85ec8d1711f..e156beb871f0 100644
--- a/drivers/clk/clk-fixed-rate.c
+++ b/drivers/clk/clk-fixed-rate.c
@@ -26,8 +26,6 @@
26 * parent - fixed parent. No clk_set_parent support 26 * parent - fixed parent. No clk_set_parent support
27 */ 27 */
28 28
29#define to_clk_fixed_rate(_hw) container_of(_hw, struct clk_fixed_rate, hw)
30
31static unsigned long clk_fixed_rate_recalc_rate(struct clk_hw *hw, 29static unsigned long clk_fixed_rate_recalc_rate(struct clk_hw *hw,
32 unsigned long parent_rate) 30 unsigned long parent_rate)
33{ 31{
diff --git a/drivers/clk/clk-fractional-divider.c b/drivers/clk/clk-fractional-divider.c
index 5c4955e33f7a..1abcd76b4993 100644
--- a/drivers/clk/clk-fractional-divider.c
+++ b/drivers/clk/clk-fractional-divider.c
@@ -16,8 +16,6 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/rational.h> 17#include <linux/rational.h>
18 18
19#define to_clk_fd(_hw) container_of(_hw, struct clk_fractional_divider, hw)
20
21static unsigned long clk_fd_recalc_rate(struct clk_hw *hw, 19static unsigned long clk_fd_recalc_rate(struct clk_hw *hw,
22 unsigned long parent_rate) 20 unsigned long parent_rate)
23{ 21{
diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index de0b322f5f58..d0d8ec8e1f1b 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -26,8 +26,6 @@
26 * parent - fixed parent. No clk_set_parent support 26 * parent - fixed parent. No clk_set_parent support
27 */ 27 */
28 28
29#define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw)
30
31/* 29/*
32 * It works on following logic: 30 * It works on following logic:
33 * 31 *
diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 19fed65587e8..cbbea2985cc9 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -31,8 +31,6 @@
31 * parent - fixed parent. No clk_set_parent support 31 * parent - fixed parent. No clk_set_parent support
32 */ 32 */
33 33
34#define to_clk_gpio(_hw) container_of(_hw, struct clk_gpio, hw)
35
36static int clk_gpio_gate_enable(struct clk_hw *hw) 34static int clk_gpio_gate_enable(struct clk_hw *hw)
37{ 35{
38 struct clk_gpio *clk = to_clk_gpio(hw); 36 struct clk_gpio *clk = to_clk_gpio(hw);
diff --git a/drivers/clk/clk-multiplier.c b/drivers/clk/clk-multiplier.c
index fe7806506bf3..9e449c7b751c 100644
--- a/drivers/clk/clk-multiplier.c
+++ b/drivers/clk/clk-multiplier.c
@@ -14,8 +14,6 @@
14#include <linux/of.h> 14#include <linux/of.h>
15#include <linux/slab.h> 15#include <linux/slab.h>
16 16
17#define to_clk_multiplier(_hw) container_of(_hw, struct clk_multiplier, hw)
18
19static unsigned long __get_mult(struct clk_multiplier *mult, 17static unsigned long __get_mult(struct clk_multiplier *mult,
20 unsigned long rate, 18 unsigned long rate,
21 unsigned long parent_rate) 19 unsigned long parent_rate)
diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c
index 5ed03c8a8df9..252188fd8bcd 100644
--- a/drivers/clk/clk-mux.c
+++ b/drivers/clk/clk-mux.c
@@ -26,8 +26,6 @@
26 * parent - parent is adjustable through clk_set_parent 26 * parent - parent is adjustable through clk_set_parent
27 */ 27 */
28 28
29#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
30
31static u8 clk_mux_get_parent(struct clk_hw *hw) 29static u8 clk_mux_get_parent(struct clk_hw *hw)
32{ 30{
33 struct clk_mux *mux = to_clk_mux(hw); 31 struct clk_mux *mux = to_clk_mux(hw);
diff --git a/drivers/clk/imx/clk-busy.c b/drivers/clk/imx/clk-busy.c
index 4bb1bc419b79..5cc99590f9a3 100644
--- a/drivers/clk/imx/clk-busy.c
+++ b/drivers/clk/imx/clk-busy.c
@@ -38,7 +38,7 @@ struct clk_busy_divider {
38 38
39static inline struct clk_busy_divider *to_clk_busy_divider(struct clk_hw *hw) 39static inline struct clk_busy_divider *to_clk_busy_divider(struct clk_hw *hw)
40{ 40{
41 struct clk_divider *div = container_of(hw, struct clk_divider, hw); 41 struct clk_divider *div = to_clk_divider(hw);
42 42
43 return container_of(div, struct clk_busy_divider, div); 43 return container_of(div, struct clk_busy_divider, div);
44} 44}
@@ -123,7 +123,7 @@ struct clk_busy_mux {
123 123
124static inline struct clk_busy_mux *to_clk_busy_mux(struct clk_hw *hw) 124static inline struct clk_busy_mux *to_clk_busy_mux(struct clk_hw *hw)
125{ 125{
126 struct clk_mux *mux = container_of(hw, struct clk_mux, hw); 126 struct clk_mux *mux = to_clk_mux(hw);
127 127
128 return container_of(mux, struct clk_busy_mux, mux); 128 return container_of(mux, struct clk_busy_mux, mux);
129} 129}
diff --git a/drivers/clk/imx/clk-fixup-div.c b/drivers/clk/imx/clk-fixup-div.c
index 21db020b1f2d..ce5722732715 100644
--- a/drivers/clk/imx/clk-fixup-div.c
+++ b/drivers/clk/imx/clk-fixup-div.c
@@ -15,7 +15,6 @@
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include "clk.h" 16#include "clk.h"
17 17
18#define to_clk_div(_hw) container_of(_hw, struct clk_divider, hw)
19#define div_mask(d) ((1 << (d->width)) - 1) 18#define div_mask(d) ((1 << (d->width)) - 1)
20 19
21/** 20/**
@@ -35,7 +34,7 @@ struct clk_fixup_div {
35 34
36static inline struct clk_fixup_div *to_clk_fixup_div(struct clk_hw *hw) 35static inline struct clk_fixup_div *to_clk_fixup_div(struct clk_hw *hw)
37{ 36{
38 struct clk_divider *divider = to_clk_div(hw); 37 struct clk_divider *divider = to_clk_divider(hw);
39 38
40 return container_of(divider, struct clk_fixup_div, divider); 39 return container_of(divider, struct clk_fixup_div, divider);
41} 40}
@@ -60,7 +59,7 @@ static int clk_fixup_div_set_rate(struct clk_hw *hw, unsigned long rate,
60 unsigned long parent_rate) 59 unsigned long parent_rate)
61{ 60{
62 struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw); 61 struct clk_fixup_div *fixup_div = to_clk_fixup_div(hw);
63 struct clk_divider *div = to_clk_div(hw); 62 struct clk_divider *div = to_clk_divider(hw);
64 unsigned int divider, value; 63 unsigned int divider, value;
65 unsigned long flags = 0; 64 unsigned long flags = 0;
66 u32 val; 65 u32 val;
diff --git a/drivers/clk/imx/clk-fixup-mux.c b/drivers/clk/imx/clk-fixup-mux.c
index 0d40b35c557c..c9b327e0a8dd 100644
--- a/drivers/clk/imx/clk-fixup-mux.c
+++ b/drivers/clk/imx/clk-fixup-mux.c
@@ -15,8 +15,6 @@
15#include <linux/slab.h> 15#include <linux/slab.h>
16#include "clk.h" 16#include "clk.h"
17 17
18#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
19
20/** 18/**
21 * struct clk_fixup_mux - imx integer fixup multiplexer clock 19 * struct clk_fixup_mux - imx integer fixup multiplexer clock
22 * @mux: the parent class 20 * @mux: the parent class
diff --git a/drivers/clk/imx/clk-gate-exclusive.c b/drivers/clk/imx/clk-gate-exclusive.c
index c12f5f2e04dc..3bd9dee618b2 100644
--- a/drivers/clk/imx/clk-gate-exclusive.c
+++ b/drivers/clk/imx/clk-gate-exclusive.c
@@ -31,7 +31,7 @@ struct clk_gate_exclusive {
31 31
32static int clk_gate_exclusive_enable(struct clk_hw *hw) 32static int clk_gate_exclusive_enable(struct clk_hw *hw)
33{ 33{
34 struct clk_gate *gate = container_of(hw, struct clk_gate, hw); 34 struct clk_gate *gate = to_clk_gate(hw);
35 struct clk_gate_exclusive *exgate = container_of(gate, 35 struct clk_gate_exclusive *exgate = container_of(gate,
36 struct clk_gate_exclusive, gate); 36 struct clk_gate_exclusive, gate);
37 u32 val = readl(gate->reg); 37 u32 val = readl(gate->reg);
diff --git a/drivers/clk/mediatek/clk-gate.c b/drivers/clk/mediatek/clk-gate.c
index 576bdb7c98b8..2a76901bf04b 100644
--- a/drivers/clk/mediatek/clk-gate.c
+++ b/drivers/clk/mediatek/clk-gate.c
@@ -25,7 +25,7 @@
25 25
26static int mtk_cg_bit_is_cleared(struct clk_hw *hw) 26static int mtk_cg_bit_is_cleared(struct clk_hw *hw)
27{ 27{
28 struct mtk_clk_gate *cg = to_clk_gate(hw); 28 struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
29 u32 val; 29 u32 val;
30 30
31 regmap_read(cg->regmap, cg->sta_ofs, &val); 31 regmap_read(cg->regmap, cg->sta_ofs, &val);
@@ -37,7 +37,7 @@ static int mtk_cg_bit_is_cleared(struct clk_hw *hw)
37 37
38static int mtk_cg_bit_is_set(struct clk_hw *hw) 38static int mtk_cg_bit_is_set(struct clk_hw *hw)
39{ 39{
40 struct mtk_clk_gate *cg = to_clk_gate(hw); 40 struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
41 u32 val; 41 u32 val;
42 42
43 regmap_read(cg->regmap, cg->sta_ofs, &val); 43 regmap_read(cg->regmap, cg->sta_ofs, &val);
@@ -49,14 +49,14 @@ static int mtk_cg_bit_is_set(struct clk_hw *hw)
49 49
50static void mtk_cg_set_bit(struct clk_hw *hw) 50static void mtk_cg_set_bit(struct clk_hw *hw)
51{ 51{
52 struct mtk_clk_gate *cg = to_clk_gate(hw); 52 struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
53 53
54 regmap_write(cg->regmap, cg->set_ofs, BIT(cg->bit)); 54 regmap_write(cg->regmap, cg->set_ofs, BIT(cg->bit));
55} 55}
56 56
57static void mtk_cg_clr_bit(struct clk_hw *hw) 57static void mtk_cg_clr_bit(struct clk_hw *hw)
58{ 58{
59 struct mtk_clk_gate *cg = to_clk_gate(hw); 59 struct mtk_clk_gate *cg = to_mtk_clk_gate(hw);
60 60
61 regmap_write(cg->regmap, cg->clr_ofs, BIT(cg->bit)); 61 regmap_write(cg->regmap, cg->clr_ofs, BIT(cg->bit));
62} 62}
diff --git a/drivers/clk/mediatek/clk-gate.h b/drivers/clk/mediatek/clk-gate.h
index 11e25c992948..b1821603b887 100644
--- a/drivers/clk/mediatek/clk-gate.h
+++ b/drivers/clk/mediatek/clk-gate.h
@@ -29,7 +29,7 @@ struct mtk_clk_gate {
29 u8 bit; 29 u8 bit;
30}; 30};
31 31
32static inline struct mtk_clk_gate *to_clk_gate(struct clk_hw *hw) 32static inline struct mtk_clk_gate *to_mtk_clk_gate(struct clk_hw *hw)
33{ 33{
34 return container_of(hw, struct mtk_clk_gate, hw); 34 return container_of(hw, struct mtk_clk_gate, hw);
35} 35}
diff --git a/drivers/clk/mvebu/common.c b/drivers/clk/mvebu/common.c
index 28aac67e7b92..daa6ebdac131 100644
--- a/drivers/clk/mvebu/common.c
+++ b/drivers/clk/mvebu/common.c
@@ -199,8 +199,6 @@ struct clk_gating_ctrl {
199 u32 saved_reg; 199 u32 saved_reg;
200}; 200};
201 201
202#define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw)
203
204static struct clk_gating_ctrl *ctrl; 202static struct clk_gating_ctrl *ctrl;
205 203
206static struct clk *clk_gating_get_src( 204static struct clk *clk_gating_get_src(
diff --git a/drivers/clk/mvebu/kirkwood.c b/drivers/clk/mvebu/kirkwood.c
index 99550f25975e..a2a8d614039d 100644
--- a/drivers/clk/mvebu/kirkwood.c
+++ b/drivers/clk/mvebu/kirkwood.c
@@ -256,8 +256,6 @@ static const struct clk_muxing_soc_desc kirkwood_mux_desc[] __initconst = {
256 11, 1, 0 }, 256 11, 1, 0 },
257}; 257};
258 258
259#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
260
261static struct clk *clk_muxing_get_src( 259static struct clk *clk_muxing_get_src(
262 struct of_phandle_args *clkspec, void *data) 260 struct of_phandle_args *clkspec, void *data)
263{ 261{
diff --git a/drivers/clk/mxs/clk-div.c b/drivers/clk/mxs/clk-div.c
index 049ee27d5a22..f75e989c578f 100644
--- a/drivers/clk/mxs/clk-div.c
+++ b/drivers/clk/mxs/clk-div.c
@@ -33,7 +33,7 @@ struct clk_div {
33 33
34static inline struct clk_div *to_clk_div(struct clk_hw *hw) 34static inline struct clk_div *to_clk_div(struct clk_hw *hw)
35{ 35{
36 struct clk_divider *divider = container_of(hw, struct clk_divider, hw); 36 struct clk_divider *divider = to_clk_divider(hw);
37 37
38 return container_of(divider, struct clk_div, divider); 38 return container_of(divider, struct clk_div, divider);
39} 39}
diff --git a/drivers/clk/nxp/clk-lpc18xx-ccu.c b/drivers/clk/nxp/clk-lpc18xx-ccu.c
index 558da89555af..f7136b94fd0e 100644
--- a/drivers/clk/nxp/clk-lpc18xx-ccu.c
+++ b/drivers/clk/nxp/clk-lpc18xx-ccu.c
@@ -28,8 +28,6 @@
28#define CCU_BRANCH_IS_BUS BIT(0) 28#define CCU_BRANCH_IS_BUS BIT(0)
29#define CCU_BRANCH_HAVE_DIV2 BIT(1) 29#define CCU_BRANCH_HAVE_DIV2 BIT(1)
30 30
31#define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw)
32
33struct lpc18xx_branch_clk_data { 31struct lpc18xx_branch_clk_data {
34 const char **name; 32 const char **name;
35 int num; 33 int num;
diff --git a/drivers/clk/st/clkgen-mux.c b/drivers/clk/st/clkgen-mux.c
index 5dc5ce217960..0d9a74b66ea3 100644
--- a/drivers/clk/st/clkgen-mux.c
+++ b/drivers/clk/st/clkgen-mux.c
@@ -822,11 +822,10 @@ err:
822 if (!clk_data->clks[i]) 822 if (!clk_data->clks[i])
823 continue; 823 continue;
824 824
825 composite = container_of(__clk_get_hw(clk_data->clks[i]), 825 composite = to_clk_composite(__clk_get_hw(clk_data->clks[i]));
826 struct clk_composite, hw); 826 kfree(to_clk_gate(composite->gate_hw));
827 kfree(container_of(composite->gate_hw, struct clk_gate, hw)); 827 kfree(to_clk_divider(composite->rate_hw));
828 kfree(container_of(composite->rate_hw, struct clk_divider, hw)); 828 kfree(to_clk_mux(composite->mux_hw));
829 kfree(container_of(composite->mux_hw, struct clk_mux, hw));
830 } 829 }
831 830
832 kfree(clk_data->clks); 831 kfree(clk_data->clks);
diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c
index dbef218fe5ec..43345c417815 100644
--- a/drivers/clk/ti/composite.c
+++ b/drivers/clk/ti/composite.c
@@ -28,8 +28,6 @@
28#undef pr_fmt 28#undef pr_fmt
29#define pr_fmt(fmt) "%s: " fmt, __func__ 29#define pr_fmt(fmt) "%s: " fmt, __func__
30 30
31#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
32
33static unsigned long ti_composite_recalc_rate(struct clk_hw *hw, 31static unsigned long ti_composite_recalc_rate(struct clk_hw *hw,
34 unsigned long parent_rate) 32 unsigned long parent_rate)
35{ 33{
diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c
index df2558350fc1..b4e5de16e561 100644
--- a/drivers/clk/ti/divider.c
+++ b/drivers/clk/ti/divider.c
@@ -26,8 +26,6 @@
26#undef pr_fmt 26#undef pr_fmt
27#define pr_fmt(fmt) "%s: " fmt, __func__ 27#define pr_fmt(fmt) "%s: " fmt, __func__
28 28
29#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
30
31#define div_mask(d) ((1 << ((d)->width)) - 1) 29#define div_mask(d) ((1 << ((d)->width)) - 1)
32 30
33static unsigned int _get_table_maxdiv(const struct clk_div_table *table) 31static unsigned int _get_table_maxdiv(const struct clk_div_table *table)
diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c
index 5429d3534363..bc05f276f32b 100644
--- a/drivers/clk/ti/gate.c
+++ b/drivers/clk/ti/gate.c
@@ -24,8 +24,6 @@
24 24
25#include "clock.h" 25#include "clock.h"
26 26
27#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
28
29#undef pr_fmt 27#undef pr_fmt
30#define pr_fmt(fmt) "%s: " fmt, __func__ 28#define pr_fmt(fmt) "%s: " fmt, __func__
31 29
diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c
index dab9ba88b9d6..618ded96ace3 100644
--- a/drivers/clk/ti/mux.c
+++ b/drivers/clk/ti/mux.c
@@ -26,8 +26,6 @@
26#undef pr_fmt 26#undef pr_fmt
27#define pr_fmt(fmt) "%s: " fmt, __func__ 27#define pr_fmt(fmt) "%s: " fmt, __func__
28 28
29#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
30
31static u8 ti_clk_mux_get_parent(struct clk_hw *hw) 29static u8 ti_clk_mux_get_parent(struct clk_hw *hw)
32{ 30{
33 struct clk_mux *mux = to_clk_mux(hw); 31 struct clk_mux *mux = to_clk_mux(hw);
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 408a60dca353..33dc814d0f43 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -276,6 +276,8 @@ struct clk_fixed_rate {
276 u8 flags; 276 u8 flags;
277}; 277};
278 278
279#define to_clk_fixed_rate(_hw) container_of(_hw, struct clk_fixed_rate, hw)
280
279extern const struct clk_ops clk_fixed_rate_ops; 281extern const struct clk_ops clk_fixed_rate_ops;
280struct clk *clk_register_fixed_rate(struct device *dev, const char *name, 282struct clk *clk_register_fixed_rate(struct device *dev, const char *name,
281 const char *parent_name, unsigned long flags, 283 const char *parent_name, unsigned long flags,
@@ -314,6 +316,8 @@ struct clk_gate {
314 spinlock_t *lock; 316 spinlock_t *lock;
315}; 317};
316 318
319#define to_clk_gate(_hw) container_of(_hw, struct clk_gate, hw)
320
317#define CLK_GATE_SET_TO_DISABLE BIT(0) 321#define CLK_GATE_SET_TO_DISABLE BIT(0)
318#define CLK_GATE_HIWORD_MASK BIT(1) 322#define CLK_GATE_HIWORD_MASK BIT(1)
319 323
@@ -376,6 +380,8 @@ struct clk_divider {
376 spinlock_t *lock; 380 spinlock_t *lock;
377}; 381};
378 382
383#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
384
379#define CLK_DIVIDER_ONE_BASED BIT(0) 385#define CLK_DIVIDER_ONE_BASED BIT(0)
380#define CLK_DIVIDER_POWER_OF_TWO BIT(1) 386#define CLK_DIVIDER_POWER_OF_TWO BIT(1)
381#define CLK_DIVIDER_ALLOW_ZERO BIT(2) 387#define CLK_DIVIDER_ALLOW_ZERO BIT(2)
@@ -441,6 +447,8 @@ struct clk_mux {
441 spinlock_t *lock; 447 spinlock_t *lock;
442}; 448};
443 449
450#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
451
444#define CLK_MUX_INDEX_ONE BIT(0) 452#define CLK_MUX_INDEX_ONE BIT(0)
445#define CLK_MUX_INDEX_BIT BIT(1) 453#define CLK_MUX_INDEX_BIT BIT(1)
446#define CLK_MUX_HIWORD_MASK BIT(2) 454#define CLK_MUX_HIWORD_MASK BIT(2)
@@ -484,6 +492,8 @@ struct clk_fixed_factor {
484 unsigned int div; 492 unsigned int div;
485}; 493};
486 494
495#define to_clk_fixed_factor(_hw) container_of(_hw, struct clk_fixed_factor, hw)
496
487extern const struct clk_ops clk_fixed_factor_ops; 497extern const struct clk_ops clk_fixed_factor_ops;
488struct clk *clk_register_fixed_factor(struct device *dev, const char *name, 498struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
489 const char *parent_name, unsigned long flags, 499 const char *parent_name, unsigned long flags,
@@ -515,6 +525,8 @@ struct clk_fractional_divider {
515 spinlock_t *lock; 525 spinlock_t *lock;
516}; 526};
517 527
528#define to_clk_fd(_hw) container_of(_hw, struct clk_fractional_divider, hw)
529
518extern const struct clk_ops clk_fractional_divider_ops; 530extern const struct clk_ops clk_fractional_divider_ops;
519struct clk *clk_register_fractional_divider(struct device *dev, 531struct clk *clk_register_fractional_divider(struct device *dev,
520 const char *name, const char *parent_name, unsigned long flags, 532 const char *name, const char *parent_name, unsigned long flags,
@@ -551,6 +563,8 @@ struct clk_multiplier {
551 spinlock_t *lock; 563 spinlock_t *lock;
552}; 564};
553 565
566#define to_clk_multiplier(_hw) container_of(_hw, struct clk_multiplier, hw)
567
554#define CLK_MULTIPLIER_ZERO_BYPASS BIT(0) 568#define CLK_MULTIPLIER_ZERO_BYPASS BIT(0)
555#define CLK_MULTIPLIER_ROUND_CLOSEST BIT(1) 569#define CLK_MULTIPLIER_ROUND_CLOSEST BIT(1)
556 570
@@ -580,6 +594,8 @@ struct clk_composite {
580 const struct clk_ops *gate_ops; 594 const struct clk_ops *gate_ops;
581}; 595};
582 596
597#define to_clk_composite(_hw) container_of(_hw, struct clk_composite, hw)
598
583struct clk *clk_register_composite(struct device *dev, const char *name, 599struct clk *clk_register_composite(struct device *dev, const char *name,
584 const char * const *parent_names, int num_parents, 600 const char * const *parent_names, int num_parents,
585 struct clk_hw *mux_hw, const struct clk_ops *mux_ops, 601 struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
@@ -602,6 +618,8 @@ struct clk_gpio {
602 struct gpio_desc *gpiod; 618 struct gpio_desc *gpiod;
603}; 619};
604 620
621#define to_clk_gpio(_hw) container_of(_hw, struct clk_gpio, hw)
622
605extern const struct clk_ops clk_gpio_gate_ops; 623extern const struct clk_ops clk_gpio_gate_ops;
606struct clk *clk_register_gpio_gate(struct device *dev, const char *name, 624struct clk *clk_register_gpio_gate(struct device *dev, const char *name,
607 const char *parent_name, unsigned gpio, bool active_low, 625 const char *parent_name, unsigned gpio, bool active_low,