forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/drivers/clk/imx/clk-gate-exclusive.c
....@@ -1,9 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2014 Freescale Semiconductor, Inc.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
74 */
85
96 #include <linux/clk-provider.h>
....@@ -58,13 +55,14 @@
5855 .is_enabled = clk_gate_exclusive_is_enabled,
5956 };
6057
61
-struct clk *imx_clk_gate_exclusive(const char *name, const char *parent,
58
+struct clk_hw *imx_clk_hw_gate_exclusive(const char *name, const char *parent,
6259 void __iomem *reg, u8 shift, u32 exclusive_mask)
6360 {
6461 struct clk_gate_exclusive *exgate;
6562 struct clk_gate *gate;
66
- struct clk *clk;
67
- struct clk_init_data init = {};
63
+ struct clk_hw *hw;
64
+ struct clk_init_data init;
65
+ int ret;
6866
6967 if (exclusive_mask == 0)
7068 return ERR_PTR(-EINVAL);
....@@ -86,9 +84,13 @@
8684 gate->hw.init = &init;
8785 exgate->exclusive_mask = exclusive_mask;
8886
89
- clk = clk_register(NULL, &gate->hw);
90
- if (IS_ERR(clk))
91
- kfree(exgate);
87
+ hw = &gate->hw;
9288
93
- return clk;
89
+ ret = clk_hw_register(NULL, hw);
90
+ if (ret) {
91
+ kfree(gate);
92
+ return ERR_PTR(ret);
93
+ }
94
+
95
+ return hw;
9496 }