aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/apm-emulation.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index 46118f845948..dd9dfa15e9d1 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -531,6 +531,7 @@ static int apm_suspend_notifier(struct notifier_block *nb,
531{ 531{
532 struct apm_user *as; 532 struct apm_user *as;
533 int err; 533 int err;
534 unsigned long apm_event;
534 535
535 /* short-cut emergency suspends */ 536 /* short-cut emergency suspends */
536 if (atomic_read(&userspace_notification_inhibit)) 537 if (atomic_read(&userspace_notification_inhibit))
@@ -538,6 +539,9 @@ static int apm_suspend_notifier(struct notifier_block *nb,
538 539
539 switch (event) { 540 switch (event) {
540 case PM_SUSPEND_PREPARE: 541 case PM_SUSPEND_PREPARE:
542 case PM_HIBERNATION_PREPARE:
543 apm_event = (event == PM_SUSPEND_PREPARE) ?
544 APM_USER_SUSPEND : APM_USER_HIBERNATION;
541 /* 545 /*
542 * Queue an event to all "writer" users that we want 546 * Queue an event to all "writer" users that we want
543 * to suspend and need their ack. 547 * to suspend and need their ack.
@@ -550,7 +554,7 @@ static int apm_suspend_notifier(struct notifier_block *nb,
550 as->writer && as->suser) { 554 as->writer && as->suser) {
551 as->suspend_state = SUSPEND_PENDING; 555 as->suspend_state = SUSPEND_PENDING;
552 atomic_inc(&suspend_acks_pending); 556 atomic_inc(&suspend_acks_pending);
553 queue_add_event(&as->queue, APM_USER_SUSPEND); 557 queue_add_event(&as->queue, apm_event);
554 } 558 }
555 } 559 }
556 560
@@ -601,11 +605,14 @@ static int apm_suspend_notifier(struct notifier_block *nb,
601 return notifier_from_errno(err); 605 return notifier_from_errno(err);
602 606
603 case PM_POST_SUSPEND: 607 case PM_POST_SUSPEND:
608 case PM_POST_HIBERNATION:
609 apm_event = (event == PM_POST_SUSPEND) ?
610 APM_NORMAL_RESUME : APM_HIBERNATION_RESUME;
604 /* 611 /*
605 * Anyone on the APM queues will think we're still suspended. 612 * Anyone on the APM queues will think we're still suspended.
606 * Send a message so everyone knows we're now awake again. 613 * Send a message so everyone knows we're now awake again.
607 */ 614 */
608 queue_event(APM_NORMAL_RESUME); 615 queue_event(apm_event);
609 616
610 /* 617 /*
611 * Finally, wake up anyone who is sleeping on the suspend. 618 * Finally, wake up anyone who is sleeping on the suspend.