forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/clk/imx/clk-pfd.c
....@@ -1,13 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright 2012 Freescale Semiconductor, Inc.
34 * Copyright 2012 Linaro Ltd.
4
- *
5
- * The code contained herein is licensed under the GNU General Public
6
- * License. You may obtain a copy of the GNU General Public License
7
- * Version 2 or later at the following locations:
8
- *
9
- * http://www.opensource.org/licenses/gpl-license.html
10
- * http://www.gnu.org/copyleft/gpl.html
115 */
126
137 #include <linux/clk-provider.h>
....@@ -18,7 +12,7 @@
1812
1913 /**
2014 * struct clk_pfd - IMX PFD clock
21
- * @clk_hw: clock source
15
+ * @hw: clock source
2216 * @reg: PFD register address
2317 * @idx: the index of PFD encoded in the register
2418 *
....@@ -127,12 +121,13 @@
127121 .is_enabled = clk_pfd_is_enabled,
128122 };
129123
130
-struct clk *imx_clk_pfd(const char *name, const char *parent_name,
124
+struct clk_hw *imx_clk_hw_pfd(const char *name, const char *parent_name,
131125 void __iomem *reg, u8 idx)
132126 {
133127 struct clk_pfd *pfd;
134
- struct clk *clk;
135
- struct clk_init_data init = {};
128
+ struct clk_hw *hw;
129
+ struct clk_init_data init;
130
+ int ret;
136131
137132 pfd = kzalloc(sizeof(*pfd), GFP_KERNEL);
138133 if (!pfd)
....@@ -148,10 +143,13 @@
148143 init.num_parents = 1;
149144
150145 pfd->hw.init = &init;
146
+ hw = &pfd->hw;
151147
152
- clk = clk_register(NULL, &pfd->hw);
153
- if (IS_ERR(clk))
148
+ ret = clk_hw_register(NULL, hw);
149
+ if (ret) {
154150 kfree(pfd);
151
+ return ERR_PTR(ret);
152
+ }
155153
156
- return clk;
154
+ return hw;
157155 }