hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/clk/socfpga/clk-periph-a10.c
....@@ -1,17 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * 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/>.
154 */
165 #include <linux/slab.h>
176 #include <linux/clk-provider.h>
....@@ -51,11 +40,12 @@
5140 {
5241 struct socfpga_periph_clk *socfpgaclk = to_socfpga_periph_clk(hwclk);
5342 u32 clk_src;
43
+ const char *name = clk_hw_get_name(hwclk);
5444
5545 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))
5949 return (clk_src >> CLK_MGR_FREE_SHIFT) &
6050 CLK_MGR_FREE_MASK;
6151 else
....@@ -75,7 +65,7 @@
7565 struct socfpga_periph_clk *periph_clk;
7666 const char *clk_name = node->name;
7767 const char *parent_name[SOCFPGA_MAX_PARENTS];
78
- struct clk_init_data init = {};
68
+ struct clk_init_data init;
7969 int rc;
8070 u32 fixed_div;
8171 u32 div_reg[3];