aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/power
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-05-17 17:23:40 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2011-05-17 17:23:40 -0400
commit2d2a9163bd4f3ba301f8138c32e4790edc30156c (patch)
treeac7d43e6c4f6a2f357454c42d762595cc358104d /kernel/power
parent1c1be3a949a61427a962771c85a347c822aeb991 (diff)
parent2e711c04dbbf7a7732a3f7073b1fc285d12b369d (diff)
Merge branch 'syscore' into for-linus
* syscore: PM: Remove sysdev suspend, resume and shutdown operations PM / PowerPC: Use struct syscore_ops instead of sysdevs for PM PM / UNICORE32: Use struct syscore_ops instead of sysdevs for PM PM / AVR32: Use struct syscore_ops instead of sysdevs for PM PM / Blackfin: Use struct syscore_ops instead of sysdevs for PM ARM / Samsung: Use struct syscore_ops for "core" power management ARM / PXA: Use struct syscore_ops for "core" power management ARM / SA1100: Use struct syscore_ops for "core" power management ARM / Integrator: Use struct syscore_ops for core PM ARM / OMAP: Use struct syscore_ops for "core" power management ARM: Use struct syscore_ops instead of sysdevs for PM in common code
Diffstat (limited to 'kernel/power')
-rw-r--r--kernel/power/hibernate.c18
-rw-r--r--kernel/power/suspend.c8
2 files changed, 3 insertions, 23 deletions
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 431721313b71..95a2ac40f48c 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -272,12 +272,7 @@ static int create_image(int platform_mode)
272 272
273 local_irq_disable(); 273 local_irq_disable();
274 274
275 error = sysdev_suspend(PMSG_FREEZE); 275 error = syscore_suspend();
276 if (!error) {
277 error = syscore_suspend();
278 if (error)
279 sysdev_resume();
280 }
281 if (error) { 276 if (error) {
282 printk(KERN_ERR "PM: Some system devices failed to power down, " 277 printk(KERN_ERR "PM: Some system devices failed to power down, "
283 "aborting hibernation\n"); 278 "aborting hibernation\n");
@@ -302,7 +297,6 @@ static int create_image(int platform_mode)
302 297
303 Power_up: 298 Power_up:
304 syscore_resume(); 299 syscore_resume();
305 sysdev_resume();
306 /* NOTE: dpm_resume_noirq() is just a resume() for devices 300 /* NOTE: dpm_resume_noirq() is just a resume() for devices
307 * that suspended with irqs off ... no overall powerup. 301 * that suspended with irqs off ... no overall powerup.
308 */ 302 */
@@ -409,12 +403,7 @@ static int resume_target_kernel(bool platform_mode)
409 403
410 local_irq_disable(); 404 local_irq_disable();
411 405
412 error = sysdev_suspend(PMSG_QUIESCE); 406 error = syscore_suspend();
413 if (!error) {
414 error = syscore_suspend();
415 if (error)
416 sysdev_resume();
417 }
418 if (error) 407 if (error)
419 goto Enable_irqs; 408 goto Enable_irqs;
420 409
@@ -442,7 +431,6 @@ static int resume_target_kernel(bool platform_mode)
442 touch_softlockup_watchdog(); 431 touch_softlockup_watchdog();
443 432
444 syscore_resume(); 433 syscore_resume();
445 sysdev_resume();
446 434
447 Enable_irqs: 435 Enable_irqs:
448 local_irq_enable(); 436 local_irq_enable();
@@ -528,7 +516,6 @@ int hibernation_platform_enter(void)
528 goto Platform_finish; 516 goto Platform_finish;
529 517
530 local_irq_disable(); 518 local_irq_disable();
531 sysdev_suspend(PMSG_HIBERNATE);
532 syscore_suspend(); 519 syscore_suspend();
533 if (pm_wakeup_pending()) { 520 if (pm_wakeup_pending()) {
534 error = -EAGAIN; 521 error = -EAGAIN;
@@ -541,7 +528,6 @@ int hibernation_platform_enter(void)
541 528
542 Power_up: 529 Power_up:
543 syscore_resume(); 530 syscore_resume();
544 sysdev_resume();
545 local_irq_enable(); 531 local_irq_enable();
546 enable_nonboot_cpus(); 532 enable_nonboot_cpus();
547 533
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index fa9fabd12eff..1c41ba215419 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -163,19 +163,13 @@ static int suspend_enter(suspend_state_t state)
163 arch_suspend_disable_irqs(); 163 arch_suspend_disable_irqs();
164 BUG_ON(!irqs_disabled()); 164 BUG_ON(!irqs_disabled());
165 165
166 error = sysdev_suspend(PMSG_SUSPEND); 166 error = syscore_suspend();
167 if (!error) {
168 error = syscore_suspend();
169 if (error)
170 sysdev_resume();
171 }
172 if (!error) { 167 if (!error) {
173 if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { 168 if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) {
174 error = suspend_ops->enter(state); 169 error = suspend_ops->enter(state);
175 events_check_enabled = false; 170 events_check_enabled = false;
176 } 171 }
177 syscore_resume(); 172 syscore_resume();
178 sysdev_resume();
179 } 173 }
180 174
181 arch_suspend_enable_irqs(); 175 arch_suspend_enable_irqs();