.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * 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. |
---|
7 | 4 | */ |
---|
8 | 5 | |
---|
9 | 6 | #include <linux/clk-provider.h> |
---|
.. | .. |
---|
58 | 55 | .is_enabled = clk_gate_exclusive_is_enabled, |
---|
59 | 56 | }; |
---|
60 | 57 | |
---|
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, |
---|
62 | 59 | void __iomem *reg, u8 shift, u32 exclusive_mask) |
---|
63 | 60 | { |
---|
64 | 61 | struct clk_gate_exclusive *exgate; |
---|
65 | 62 | 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; |
---|
68 | 66 | |
---|
69 | 67 | if (exclusive_mask == 0) |
---|
70 | 68 | return ERR_PTR(-EINVAL); |
---|
.. | .. |
---|
86 | 84 | gate->hw.init = &init; |
---|
87 | 85 | exgate->exclusive_mask = exclusive_mask; |
---|
88 | 86 | |
---|
89 | | - clk = clk_register(NULL, &gate->hw); |
---|
90 | | - if (IS_ERR(clk)) |
---|
91 | | - kfree(exgate); |
---|
| 87 | + hw = &gate->hw; |
---|
92 | 88 | |
---|
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; |
---|
94 | 96 | } |
---|