.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * 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 |
---|
10 | 4 | */ |
---|
11 | 5 | |
---|
| 6 | +#include <linux/bits.h> |
---|
12 | 7 | #include <linux/clk-provider.h> |
---|
13 | 8 | #include <linux/err.h> |
---|
14 | 9 | #include <linux/io.h> |
---|
.. | .. |
---|
48 | 43 | { |
---|
49 | 44 | struct clk_fixup_mux *fixup_mux = to_clk_fixup_mux(hw); |
---|
50 | 45 | struct clk_mux *mux = to_clk_mux(hw); |
---|
51 | | - unsigned long flags = 0; |
---|
| 46 | + unsigned long flags; |
---|
52 | 47 | u32 val; |
---|
53 | 48 | |
---|
54 | 49 | spin_lock_irqsave(mux->lock, flags); |
---|
.. | .. |
---|
69 | 64 | .set_parent = clk_fixup_mux_set_parent, |
---|
70 | 65 | }; |
---|
71 | 66 | |
---|
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, |
---|
73 | 68 | u8 shift, u8 width, const char * const *parents, |
---|
74 | 69 | int num_parents, void (*fixup)(u32 *val)) |
---|
75 | 70 | { |
---|
76 | 71 | 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; |
---|
79 | 75 | |
---|
80 | 76 | if (!fixup) |
---|
81 | 77 | return ERR_PTR(-EINVAL); |
---|
.. | .. |
---|
98 | 94 | fixup_mux->ops = &clk_mux_ops; |
---|
99 | 95 | fixup_mux->fixup = fixup; |
---|
100 | 96 | |
---|
101 | | - clk = clk_register(NULL, &fixup_mux->mux.hw); |
---|
102 | | - if (IS_ERR(clk)) |
---|
103 | | - kfree(fixup_mux); |
---|
| 97 | + hw = &fixup_mux->mux.hw; |
---|
104 | 98 | |
---|
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; |
---|
106 | 106 | } |
---|