forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-11 04dd17822334871b23ea2862f7798fb0e0007777
kernel/arch/arm/mach-rockchip/pm.c
....@@ -1,16 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2014, Fuzhou Rockchip Electronics Co., Ltd
34 * Author: Tony Xie <tony.xie@rock-chips.com>
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
145 */
156
167 #include <linux/init.h>
....@@ -59,7 +50,7 @@
5950 return l2ctlr;
6051 }
6152
62
-static void rk3288_config_bootdata(void)
53
+static void __init rk3288_config_bootdata(void)
6354 {
6455 rkpm_bootdata_cpusp = rk3288_bootram_phy + (SZ_4K - 8);
6556 rkpm_bootdata_cpu_code = __pa_symbol(cpu_resume);
....@@ -230,7 +221,7 @@
230221 pr_err("%s: Suspend finish failed\n", __func__);
231222 }
232223
233
-static int rk3288_suspend_init(struct device_node *np)
224
+static int __init rk3288_suspend_init(struct device_node *np)
234225 {
235226 struct device_node *sram_np;
236227 struct resource res;
....@@ -266,12 +257,14 @@
266257 rk3288_bootram_base = of_iomap(sram_np, 0);
267258 if (!rk3288_bootram_base) {
268259 pr_err("%s: could not map bootram base\n", __func__);
260
+ of_node_put(sram_np);
269261 return -ENOMEM;
270262 }
271263
272264 ret = of_address_to_resource(sram_np, 0, &res);
273265 if (ret) {
274266 pr_err("%s: could not get bootram phy addr\n", __func__);
267
+ of_node_put(sram_np);
275268 return ret;
276269 }
277270 rk3288_bootram_phy = res.start;