hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/clk/imx/clk-fixup-mux.c
....@@ -1,14 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2013 Freescale Semiconductor, Inc.
3
- *
4
- * The code contained herein is licensed under the GNU General Public
5
- * License. You may obtain a copy of the GNU General Public License
6
- * Version 2 or later at the following locations:
7
- *
8
- * http://www.opensource.org/licenses/gpl-license.html
9
- * http://www.gnu.org/copyleft/gpl.html
104 */
115
6
+#include <linux/bits.h>
127 #include <linux/clk-provider.h>
138 #include <linux/err.h>
149 #include <linux/io.h>
....@@ -48,7 +43,7 @@
4843 {
4944 struct clk_fixup_mux *fixup_mux = to_clk_fixup_mux(hw);
5045 struct clk_mux *mux = to_clk_mux(hw);
51
- unsigned long flags = 0;
46
+ unsigned long flags;
5247 u32 val;
5348
5449 spin_lock_irqsave(mux->lock, flags);
....@@ -69,13 +64,14 @@
6964 .set_parent = clk_fixup_mux_set_parent,
7065 };
7166
72
-struct clk *imx_clk_fixup_mux(const char *name, void __iomem *reg,
67
+struct clk_hw *imx_clk_hw_fixup_mux(const char *name, void __iomem *reg,
7368 u8 shift, u8 width, const char * const *parents,
7469 int num_parents, void (*fixup)(u32 *val))
7570 {
7671 struct clk_fixup_mux *fixup_mux;
77
- struct clk *clk;
78
- struct clk_init_data init = {};
72
+ struct clk_hw *hw;
73
+ struct clk_init_data init;
74
+ int ret;
7975
8076 if (!fixup)
8177 return ERR_PTR(-EINVAL);
....@@ -98,9 +94,13 @@
9894 fixup_mux->ops = &clk_mux_ops;
9995 fixup_mux->fixup = fixup;
10096
101
- clk = clk_register(NULL, &fixup_mux->mux.hw);
102
- if (IS_ERR(clk))
103
- kfree(fixup_mux);
97
+ hw = &fixup_mux->mux.hw;
10498
105
- return clk;
99
+ ret = clk_hw_register(NULL, hw);
100
+ if (ret) {
101
+ kfree(fixup_mux);
102
+ return ERR_PTR(ret);
103
+ }
104
+
105
+ return hw;
106106 }