hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/nios2/kernel/cpuinfo.c
....@@ -1,22 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2013 Altera Corporation
34 * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch>
45 *
56 * Based on cpuinfo.c from microblaze
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License as published by
9
- * the Free Software Foundation; either version 2 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU General Public License
18
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
19
- *
207 */
218
229 #include <linux/kernel.h>
....@@ -47,7 +34,7 @@
4734 const char *str;
4835 int len;
4936
50
- cpu = of_find_node_by_type(NULL, "cpu");
37
+ cpu = of_get_cpu_node(0, NULL);
5138 if (!cpu)
5239 panic("%s: No CPU found in devicetree!\n", __func__);
5340
....@@ -120,6 +107,8 @@
120107 cpuinfo.reset_addr = fcpu(cpu, "altr,reset-addr");
121108 cpuinfo.exception_addr = fcpu(cpu, "altr,exception-addr");
122109 cpuinfo.fast_tlb_miss_exc_addr = fcpu(cpu, "altr,fast-tlb-miss-addr");
110
+
111
+ of_node_put(cpu);
123112 }
124113
125114 #ifdef CONFIG_PROC_FS