forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/clk/imx/clk-pllv1.c
....@@ -1,4 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0
2
+#include <linux/bits.h>
23 #include <linux/clk-provider.h>
34 #include <linux/io.h>
45 #include <linux/slab.h>
....@@ -111,12 +112,13 @@
111112 .recalc_rate = clk_pllv1_recalc_rate,
112113 };
113114
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,
115116 const char *parent, void __iomem *base)
116117 {
117118 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;
120122
121123 pll = kmalloc(sizeof(*pll), GFP_KERNEL);
122124 if (!pll)
....@@ -132,10 +134,13 @@
132134 init.num_parents = 1;
133135
134136 pll->hw.init = &init;
137
+ hw = &pll->hw;
135138
136
- clk = clk_register(NULL, &pll->hw);
137
- if (IS_ERR(clk))
139
+ ret = clk_hw_register(NULL, hw);
140
+ if (ret) {
138141 kfree(pll);
142
+ return ERR_PTR(ret);
143
+ }
139144
140
- return clk;
145
+ return hw;
141146 }