| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2013 Altera Corporation |
|---|
| 3 | 4 | * Copyright (C) 2011 Tobias Klauser <tklauser@distanz.ch> |
|---|
| 4 | 5 | * |
|---|
| 5 | 6 | * 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 | | - * |
|---|
| 20 | 7 | */ |
|---|
| 21 | 8 | |
|---|
| 22 | 9 | #include <linux/kernel.h> |
|---|
| .. | .. |
|---|
| 47 | 34 | const char *str; |
|---|
| 48 | 35 | int len; |
|---|
| 49 | 36 | |
|---|
| 50 | | - cpu = of_find_node_by_type(NULL, "cpu"); |
|---|
| 37 | + cpu = of_get_cpu_node(0, NULL); |
|---|
| 51 | 38 | if (!cpu) |
|---|
| 52 | 39 | panic("%s: No CPU found in devicetree!\n", __func__); |
|---|
| 53 | 40 | |
|---|
| .. | .. |
|---|
| 120 | 107 | cpuinfo.reset_addr = fcpu(cpu, "altr,reset-addr"); |
|---|
| 121 | 108 | cpuinfo.exception_addr = fcpu(cpu, "altr,exception-addr"); |
|---|
| 122 | 109 | cpuinfo.fast_tlb_miss_exc_addr = fcpu(cpu, "altr,fast-tlb-miss-addr"); |
|---|
| 110 | + |
|---|
| 111 | + of_node_put(cpu); |
|---|
| 123 | 112 | } |
|---|
| 124 | 113 | |
|---|
| 125 | 114 | #ifdef CONFIG_PROC_FS |
|---|