aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2011-02-15 15:22:24 -0500
committerRafael J. Wysocki <rjw@sisk.pl>2011-03-14 19:43:16 -0400
commit6831c6edc7b272a08dd2a6c71bb183a48fe98ae6 (patch)
treefc3ef253f12bd9f2d211271c09a5475ed19b18b0 /arch/x86/kernel
parente8665002477f0278f84f898145b1f141ba26ee26 (diff)
PM: Drop pm_flags that is not necessary
The variable pm_flags is used to prevent APM from being enabled along with ACPI, which would lead to problems. However, acpi_init() is always called before apm_init() and after acpi_init() has returned, it is known whether or not ACPI will be used. Namely, if acpi_disabled is not set after acpi_init() has returned, this means that ACPI is enabled. Thus, it is sufficient to check acpi_disabled in apm_init() to prevent APM from being enabled in parallel with ACPI. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/apm_32.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 0e4f24c2a746..15f47f741983 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -227,6 +227,7 @@
227#include <linux/suspend.h> 227#include <linux/suspend.h>
228#include <linux/kthread.h> 228#include <linux/kthread.h>
229#include <linux/jiffies.h> 229#include <linux/jiffies.h>
230#include <linux/acpi.h>
230 231
231#include <asm/system.h> 232#include <asm/system.h>
232#include <asm/uaccess.h> 233#include <asm/uaccess.h>
@@ -2331,12 +2332,11 @@ static int __init apm_init(void)
2331 apm_info.disabled = 1; 2332 apm_info.disabled = 1;
2332 return -ENODEV; 2333 return -ENODEV;
2333 } 2334 }
2334 if (pm_flags & PM_ACPI) { 2335 if (!acpi_disabled) {
2335 printk(KERN_NOTICE "apm: overridden by ACPI.\n"); 2336 printk(KERN_NOTICE "apm: overridden by ACPI.\n");
2336 apm_info.disabled = 1; 2337 apm_info.disabled = 1;
2337 return -ENODEV; 2338 return -ENODEV;
2338 } 2339 }
2339 pm_flags |= PM_APM;
2340 2340
2341 /* 2341 /*
2342 * Set up the long jump entry point to the APM BIOS, which is called 2342 * Set up the long jump entry point to the APM BIOS, which is called
@@ -2428,7 +2428,6 @@ static void __exit apm_exit(void)
2428 kthread_stop(kapmd_task); 2428 kthread_stop(kapmd_task);
2429 kapmd_task = NULL; 2429 kapmd_task = NULL;
2430 } 2430 }
2431 pm_flags &= ~PM_APM;
2432} 2431}
2433 2432
2434module_init(apm_init); 2433module_init(apm_init);