Skip to content

Commit

Permalink
[ARM] 3229/1: Remove uneeded ARM apm dependency on PM_LEGACY
Browse files Browse the repository at this point in the history
Patch from Richard Purdie

ARM doesn't use ACPI so ARM's apm implementation has no need to depend
on PM_LEGACY. This patch removes that dependency.

Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Richard Purdie authored and Russell King committed Jan 5, 2006
1 parent b7557de commit 53b7c2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
1 change: 0 additions & 1 deletion 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 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 53b7c2b

Please sign in to comment.