.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright 2011-2012 Calxeda, Inc. |
---|
3 | 4 | * Copyright (C) 2012-2013 Altera Corporation <www.altera.com> |
---|
4 | 5 | * |
---|
5 | | - * This program is free software; you can redistribute it and/or modify |
---|
6 | | - * it under the terms of the GNU General Public License as published by |
---|
7 | | - * the Free Software Foundation; either version 2 of the License, or |
---|
8 | | - * (at your option) any later version. |
---|
9 | | - * |
---|
10 | | - * This program is distributed in the hope that it will be useful, |
---|
11 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
12 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
13 | | - * GNU General Public License for more details. |
---|
14 | | - * |
---|
15 | 6 | * Based from clk-highbank.c |
---|
16 | | - * |
---|
17 | 7 | */ |
---|
18 | 8 | #include <linux/slab.h> |
---|
19 | 9 | #include <linux/clk-provider.h> |
---|
.. | .. |
---|
61 | 51 | const struct clk_ops *ops) |
---|
62 | 52 | { |
---|
63 | 53 | u32 reg; |
---|
64 | | - struct clk *clk; |
---|
| 54 | + struct clk_hw *hw_clk; |
---|
65 | 55 | struct socfpga_periph_clk *periph_clk; |
---|
66 | 56 | const char *clk_name = node->name; |
---|
67 | 57 | const char *parent_name[SOCFPGA_MAX_PARENTS]; |
---|
68 | | - struct clk_init_data init = {}; |
---|
| 58 | + struct clk_init_data init; |
---|
69 | 59 | int rc; |
---|
70 | 60 | u32 fixed_div; |
---|
71 | 61 | u32 div_reg[3]; |
---|
.. | .. |
---|
104 | 94 | init.parent_names = parent_name; |
---|
105 | 95 | |
---|
106 | 96 | periph_clk->hw.hw.init = &init; |
---|
| 97 | + hw_clk = &periph_clk->hw.hw; |
---|
107 | 98 | |
---|
108 | | - clk = clk_register(NULL, &periph_clk->hw.hw); |
---|
109 | | - if (WARN_ON(IS_ERR(clk))) { |
---|
| 99 | + if (clk_hw_register(NULL, hw_clk)) { |
---|
110 | 100 | kfree(periph_clk); |
---|
111 | 101 | return; |
---|
112 | 102 | } |
---|
113 | | - rc = of_clk_add_provider(node, of_clk_src_simple_get, clk); |
---|
| 103 | + rc = of_clk_add_provider(node, of_clk_src_simple_get, hw_clk); |
---|
114 | 104 | } |
---|
115 | 105 | |
---|
116 | 106 | void __init socfpga_periph_init(struct device_node *node) |
---|