| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright 2012 Freescale Semiconductor, Inc. |
|---|
| 3 | 4 | * 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 |
|---|
| 11 | 5 | */ |
|---|
| 12 | 6 | |
|---|
| 13 | 7 | #include <linux/clk-provider.h> |
|---|
| .. | .. |
|---|
| 18 | 12 | |
|---|
| 19 | 13 | /** |
|---|
| 20 | 14 | * struct clk_pfd - IMX PFD clock |
|---|
| 21 | | - * @clk_hw: clock source |
|---|
| 15 | + * @hw: clock source |
|---|
| 22 | 16 | * @reg: PFD register address |
|---|
| 23 | 17 | * @idx: the index of PFD encoded in the register |
|---|
| 24 | 18 | * |
|---|
| .. | .. |
|---|
| 127 | 121 | .is_enabled = clk_pfd_is_enabled, |
|---|
| 128 | 122 | }; |
|---|
| 129 | 123 | |
|---|
| 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, |
|---|
| 131 | 125 | void __iomem *reg, u8 idx) |
|---|
| 132 | 126 | { |
|---|
| 133 | 127 | 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; |
|---|
| 136 | 131 | |
|---|
| 137 | 132 | pfd = kzalloc(sizeof(*pfd), GFP_KERNEL); |
|---|
| 138 | 133 | if (!pfd) |
|---|
| .. | .. |
|---|
| 148 | 143 | init.num_parents = 1; |
|---|
| 149 | 144 | |
|---|
| 150 | 145 | pfd->hw.init = &init; |
|---|
| 146 | + hw = &pfd->hw; |
|---|
| 151 | 147 | |
|---|
| 152 | | - clk = clk_register(NULL, &pfd->hw); |
|---|
| 153 | | - if (IS_ERR(clk)) |
|---|
| 148 | + ret = clk_hw_register(NULL, hw); |
|---|
| 149 | + if (ret) { |
|---|
| 154 | 150 | kfree(pfd); |
|---|
| 151 | + return ERR_PTR(ret); |
|---|
| 152 | + } |
|---|
| 155 | 153 | |
|---|
| 156 | | - return clk; |
|---|
| 154 | + return hw; |
|---|
| 157 | 155 | } |
|---|