.. | .. |
---|
1 | 1 | // SPDX-License-Identifier: GPL-2.0 |
---|
| 2 | +#include <linux/bits.h> |
---|
2 | 3 | #include <linux/clk-provider.h> |
---|
3 | 4 | #include <linux/io.h> |
---|
4 | 5 | #include <linux/slab.h> |
---|
.. | .. |
---|
111 | 112 | .recalc_rate = clk_pllv1_recalc_rate, |
---|
112 | 113 | }; |
---|
113 | 114 | |
---|
114 | | -struct clk *imx_clk_pllv1(enum imx_pllv1_type type, const char *name, |
---|
| 115 | +struct clk_hw *imx_clk_hw_pllv1(enum imx_pllv1_type type, const char *name, |
---|
115 | 116 | const char *parent, void __iomem *base) |
---|
116 | 117 | { |
---|
117 | 118 | struct clk_pllv1 *pll; |
---|
118 | | - struct clk *clk; |
---|
119 | | - struct clk_init_data init = {}; |
---|
| 119 | + struct clk_hw *hw; |
---|
| 120 | + struct clk_init_data init; |
---|
| 121 | + int ret; |
---|
120 | 122 | |
---|
121 | 123 | pll = kmalloc(sizeof(*pll), GFP_KERNEL); |
---|
122 | 124 | if (!pll) |
---|
.. | .. |
---|
132 | 134 | init.num_parents = 1; |
---|
133 | 135 | |
---|
134 | 136 | pll->hw.init = &init; |
---|
| 137 | + hw = &pll->hw; |
---|
135 | 138 | |
---|
136 | | - clk = clk_register(NULL, &pll->hw); |
---|
137 | | - if (IS_ERR(clk)) |
---|
| 139 | + ret = clk_hw_register(NULL, hw); |
---|
| 140 | + if (ret) { |
---|
138 | 141 | kfree(pll); |
---|
| 142 | + return ERR_PTR(ret); |
---|
| 143 | + } |
---|
139 | 144 | |
---|
140 | | - return clk; |
---|
| 145 | + return hw; |
---|
141 | 146 | } |
---|