forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/arm/mach-shmobile/pm-rcar-gen2.c
....@@ -1,13 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * R-Car Generation 2 Power management support
34 *
45 * Copyright (C) 2013 - 2015 Renesas Electronics Corporation
56 * Copyright (C) 2011 Renesas Solutions Corp.
67 * Copyright (C) 2011 Magnus Damm
7
- *
8
- * This file is subject to the terms and conditions of the GNU General Public
9
- * License. See the file "COPYING" in the main directory of this archive
10
- * for more details.
118 */
129
1310 #include <linux/kernel.h>
....@@ -50,7 +47,7 @@
5047 void __iomem *p;
5148 u32 bar;
5249 static int once;
53
- struct device_node *np, *cpus;
50
+ struct device_node *np;
5451 bool has_a7 = false;
5552 bool has_a15 = false;
5653 struct resource res;
....@@ -59,11 +56,7 @@
5956 if (once++)
6057 return;
6158
62
- cpus = of_find_node_by_path("/cpus");
63
- if (!cpus)
64
- return;
65
-
66
- for_each_child_of_node(cpus, np) {
59
+ for_each_of_cpu_node(np) {
6760 if (of_device_is_compatible(np, "arm,cortex-a15"))
6861 has_a15 = true;
6962 else if (of_device_is_compatible(np, "arm,cortex-a7"))
....@@ -79,6 +72,7 @@
7972 }
8073
8174 error = of_address_to_resource(np, 0, &res);
75
+ of_node_put(np);
8276 if (error) {
8377 pr_err("Failed to get smp-sram address: %d\n", error);
8478 return;
....@@ -109,7 +103,7 @@
109103 iounmap(p);
110104
111105 /* setup reset vectors */
112
- p = ioremap_nocache(RST, 0x63);
106
+ p = ioremap(RST, 0x63);
113107 bar = phys_to_sbar(res.start);
114108 if (has_a15) {
115109 writel_relaxed(bar, p + CA15BAR);