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>
This commit is contained in:
@ -227,6 +227,7 @@
|
||||
#include <linux/suspend.h>
|
||||
#include <linux/kthread.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/acpi.h>
|
||||
|
||||
#include <asm/system.h>
|
||||
#include <asm/uaccess.h>
|
||||
@ -2331,12 +2332,11 @@ static int __init apm_init(void)
|
||||
apm_info.disabled = 1;
|
||||
return -ENODEV;
|
||||
}
|
||||
if (pm_flags & PM_ACPI) {
|
||||
if (!acpi_disabled) {
|
||||
printk(KERN_NOTICE "apm: overridden by ACPI.\n");
|
||||
apm_info.disabled = 1;
|
||||
return -ENODEV;
|
||||
}
|
||||
pm_flags |= PM_APM;
|
||||
|
||||
/*
|
||||
* Set up the long jump entry point to the APM BIOS, which is called
|
||||
@ -2428,7 +2428,6 @@ static void __exit apm_exit(void)
|
||||
kthread_stop(kapmd_task);
|
||||
kapmd_task = NULL;
|
||||
}
|
||||
pm_flags &= ~PM_APM;
|
||||
}
|
||||
|
||||
module_init(apm_init);
|
||||
|
Reference in New Issue
Block a user