Skip to content

Commit cf13951

Browse files
mszyprowSylwester Nawrocki
authored andcommitted
clk: samsung: exynos-clkout: Convert to the new clk_hw API
Clock providers should use the new struct clk_hw based API, so convert Exynos CLKOUT clock provider to the new approach. Signed-off-by: Marek Szyprowski <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]>
1 parent 5b2c3da commit cf13951

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

drivers/clk/samsung/clk-exynos-clkout.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ struct exynos_clkout {
2929
struct clk_gate gate;
3030
struct clk_mux mux;
3131
spinlock_t slock;
32-
struct clk_onecell_data data;
33-
struct clk *clk_table[EXYNOS_CLKOUT_NR_CLKS];
3432
void __iomem *reg;
3533
u32 pmu_debug_save;
34+
struct clk_hw_onecell_data data;
3635
};
3736

3837
static struct exynos_clkout *clkout;
@@ -62,7 +61,9 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask)
6261
int ret;
6362
int i;
6463

65-
clkout = kzalloc(sizeof(*clkout), GFP_KERNEL);
64+
clkout = kzalloc(sizeof(*clkout) +
65+
sizeof(*clkout->data.hws) * EXYNOS_CLKOUT_NR_CLKS,
66+
GFP_KERNEL);
6667
if (!clkout)
6768
return;
6869

@@ -100,17 +101,16 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask)
100101
clkout->mux.shift = EXYNOS_CLKOUT_MUX_SHIFT;
101102
clkout->mux.lock = &clkout->slock;
102103

103-
clkout->clk_table[0] = clk_register_composite(NULL, "clkout",
104+
clkout->data.hws[0] = clk_hw_register_composite(NULL, "clkout",
104105
parent_names, parent_count, &clkout->mux.hw,
105106
&clk_mux_ops, NULL, NULL, &clkout->gate.hw,
106107
&clk_gate_ops, CLK_SET_RATE_PARENT
107108
| CLK_SET_RATE_NO_REPARENT);
108-
if (IS_ERR(clkout->clk_table[0]))
109+
if (IS_ERR(clkout->data.hws[0]))
109110
goto err_unmap;
110111

111-
clkout->data.clks = clkout->clk_table;
112-
clkout->data.clk_num = EXYNOS_CLKOUT_NR_CLKS;
113-
ret = of_clk_add_provider(node, of_clk_src_onecell_get, &clkout->data);
112+
clkout->data.num = EXYNOS_CLKOUT_NR_CLKS;
113+
ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get, &clkout->data);
114114
if (ret)
115115
goto err_clk_unreg;
116116

@@ -119,7 +119,7 @@ static void __init exynos_clkout_init(struct device_node *node, u32 mux_mask)
119119
return;
120120

121121
err_clk_unreg:
122-
clk_unregister(clkout->clk_table[0]);
122+
clk_hw_unregister(clkout->data.hws[0]);
123123
err_unmap:
124124
iounmap(clkout->reg);
125125
clks_put:

0 commit comments

Comments
 (0)