.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (C) 2015 Altera Corporation. All rights reserved |
---|
3 | | - * |
---|
4 | | - * This program is free software; you can redistribute it and/or modify |
---|
5 | | - * it under the terms and conditions of the GNU General Public License, |
---|
6 | | - * version 2, as published by the Free Software Foundation. |
---|
7 | | - * |
---|
8 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
---|
9 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
---|
10 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
---|
11 | | - * more details. |
---|
12 | | - * |
---|
13 | | - * You should have received a copy of the GNU General Public License along with |
---|
14 | | - * this program. If not, see <http://www.gnu.org/licenses/>. |
---|
15 | 4 | */ |
---|
16 | 5 | #include <linux/slab.h> |
---|
17 | 6 | #include <linux/clk-provider.h> |
---|
.. | .. |
---|
51 | 40 | { |
---|
52 | 41 | struct socfpga_periph_clk *socfpgaclk = to_socfpga_periph_clk(hwclk); |
---|
53 | 42 | u32 clk_src; |
---|
| 43 | + const char *name = clk_hw_get_name(hwclk); |
---|
54 | 44 | |
---|
55 | 45 | clk_src = readl(socfpgaclk->hw.reg); |
---|
56 | | - if (streq(hwclk->init->name, SOCFPGA_MPU_FREE_CLK) || |
---|
57 | | - streq(hwclk->init->name, SOCFPGA_NOC_FREE_CLK) || |
---|
58 | | - streq(hwclk->init->name, SOCFPGA_SDMMC_FREE_CLK)) |
---|
| 46 | + if (streq(name, SOCFPGA_MPU_FREE_CLK) || |
---|
| 47 | + streq(name, SOCFPGA_NOC_FREE_CLK) || |
---|
| 48 | + streq(name, SOCFPGA_SDMMC_FREE_CLK)) |
---|
59 | 49 | return (clk_src >> CLK_MGR_FREE_SHIFT) & |
---|
60 | 50 | CLK_MGR_FREE_MASK; |
---|
61 | 51 | else |
---|
.. | .. |
---|
75 | 65 | struct socfpga_periph_clk *periph_clk; |
---|
76 | 66 | const char *clk_name = node->name; |
---|
77 | 67 | const char *parent_name[SOCFPGA_MAX_PARENTS]; |
---|
78 | | - struct clk_init_data init = {}; |
---|
| 68 | + struct clk_init_data init; |
---|
79 | 69 | int rc; |
---|
80 | 70 | u32 fixed_div; |
---|
81 | 71 | u32 div_reg[3]; |
---|