Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16760
b: refs/heads/master
c: 53b7c2b
h: refs/heads/master
v: v3
  • Loading branch information
Richard Purdie authored and Russell King committed Jan 5, 2006
1 parent abfa9b7 commit 3e71ac8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7557de41a04346cb545d4dda7088760cb96e713
refs/heads/master: 53b7c2b243bd31f857dddabd9339f2dd6ae3fb67
1 change: 0 additions & 1 deletion trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,6 @@ source "kernel/power/Kconfig"

config APM
tristate "Advanced Power Management Emulation"
depends on PM_LEGACY
---help---
APM is a BIOS specification for saving power using several different
techniques. This is mostly useful for battery powered laptops with
Expand Down
19 changes: 7 additions & 12 deletions trunk/arch/arm/kernel/apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <linux/apm_bios.h>
#include <linux/sched.h>
#include <linux/pm.h>
#include <linux/pm_legacy.h>
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/list.h>
Expand Down Expand Up @@ -81,6 +80,7 @@ struct apm_user {
*/
static int suspends_pending;
static int apm_disabled;
static int arm_apm_active;

static DECLARE_WAIT_QUEUE_HEAD(apm_waitqueue);
static DECLARE_WAIT_QUEUE_HEAD(apm_suspend_waitqueue);
Expand Down Expand Up @@ -477,9 +477,9 @@ static int kapmd(void *arg)
apm_event_t event;

wait_event_interruptible(kapmd_wait,
!queue_empty(&kapmd_queue) || !pm_active);
!queue_empty(&kapmd_queue) || !arm_apm_active);

if (!pm_active)
if (!arm_apm_active)
break;

spin_lock_irq(&kapmd_queue_lock);
Expand Down Expand Up @@ -522,16 +522,11 @@ static int __init apm_init(void)
return -ENODEV;
}

if (PM_IS_ACTIVE()) {
printk(KERN_NOTICE "apm: overridden by ACPI.\n");
return -EINVAL;
}

pm_active = 1;
arm_apm_active = 1;

ret = kernel_thread(kapmd, NULL, CLONE_KERNEL);
if (ret < 0) {
pm_active = 0;
arm_apm_active = 0;
return ret;
}

Expand All @@ -543,7 +538,7 @@ static int __init apm_init(void)
if (ret != 0) {
remove_proc_entry("apm", NULL);

pm_active = 0;
arm_apm_active = 0;
wake_up(&kapmd_wait);
wait_for_completion(&kapmd_exit);
}
Expand All @@ -556,7 +551,7 @@ static void __exit apm_exit(void)
misc_deregister(&apm_device);
remove_proc_entry("apm", NULL);

pm_active = 0;
arm_apm_active = 0;
wake_up(&kapmd_wait);
wait_for_completion(&kapmd_exit);
}
Expand Down

0 comments on commit 3e71ac8

Please sign in to comment.