aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/power/user.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c
index d65305b515b1..09468ec61124 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -181,34 +181,25 @@ static inline int snapshot_suspend(int platform_suspend)
181 return error; 181 return error;
182} 182}
183 183
184static inline int snapshot_restore(int platform_suspend) 184static inline int snapshot_restore(void)
185{ 185{
186 int error; 186 int error;
187 187
188 mutex_lock(&pm_mutex); 188 mutex_lock(&pm_mutex);
189 pm_prepare_console(); 189 pm_prepare_console();
190 if (platform_suspend) {
191 error = platform_prepare();
192 if (error)
193 goto Finish;
194 }
195 suspend_console(); 190 suspend_console();
196 error = device_suspend(PMSG_PRETHAW); 191 error = device_suspend(PMSG_PRETHAW);
197 if (error) 192 if (error)
198 goto Resume_devices; 193 goto Finish;
199 194
200 error = disable_nonboot_cpus(); 195 error = disable_nonboot_cpus();
201 if (!error) 196 if (!error)
202 error = swsusp_resume(); 197 error = swsusp_resume();
203 198
204 enable_nonboot_cpus(); 199 enable_nonboot_cpus();
205 Resume_devices: 200 Finish:
206 if (platform_suspend)
207 platform_finish();
208
209 device_resume(); 201 device_resume();
210 resume_console(); 202 resume_console();
211 Finish:
212 pm_restore_console(); 203 pm_restore_console();
213 mutex_unlock(&pm_mutex); 204 mutex_unlock(&pm_mutex);
214 return error; 205 return error;
@@ -274,7 +265,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
274 error = -EPERM; 265 error = -EPERM;
275 break; 266 break;
276 } 267 }
277 error = snapshot_restore(data->platform_suspend); 268 error = snapshot_restore();
278 break; 269 break;
279 270
280 case SNAPSHOT_FREE: 271 case SNAPSHOT_FREE: