forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f9004dbfff8a3fbbd7e2a88c8a4327c7f2f8e5b2
kernel/arch/arm/mach-lpc32xx/pm.c
....@@ -70,8 +70,7 @@
7070
7171 #include <asm/cacheflush.h>
7272
73
-#include <mach/hardware.h>
74
-#include <mach/platform.h>
73
+#include "lpc32xx.h"
7574 #include "common.h"
7675
7776 #define TEMP_IRAM_AREA IO_ADDRESS(LPC32XX_IRAM_BASE)
....@@ -86,17 +85,10 @@
8685 void *iram_swap_area;
8786
8887 /* Allocate some space for temporary IRAM storage */
89
- iram_swap_area = kmalloc(lpc32xx_sys_suspend_sz, GFP_KERNEL);
90
- if (!iram_swap_area) {
91
- printk(KERN_ERR
92
- "PM Suspend: cannot allocate memory to save portion "
93
- "of SRAM\n");
88
+ iram_swap_area = kmemdup((void *)TEMP_IRAM_AREA,
89
+ lpc32xx_sys_suspend_sz, GFP_KERNEL);
90
+ if (!iram_swap_area)
9491 return -ENOMEM;
95
- }
96
-
97
- /* Backup a small area of IRAM used for the suspend code */
98
- memcpy(iram_swap_area, (void *) TEMP_IRAM_AREA,
99
- lpc32xx_sys_suspend_sz);
10092
10193 /*
10294 * Copy code to suspend system into IRAM. The suspend code