mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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 <[email protected]> Acked-by: Len Brown <[email protected]>
This commit is contained in:
parent
e866500247
commit
6831c6edc7
5 changed files with 7 additions and 48 deletions
|
|
@ -1007,8 +1007,7 @@ struct kobject *acpi_kobj;
|
|||
|
||||
static int __init acpi_init(void)
|
||||
{
|
||||
int result = 0;
|
||||
|
||||
int result;
|
||||
|
||||
if (acpi_disabled) {
|
||||
printk(KERN_INFO PREFIX "Interpreter disabled.\n");
|
||||
|
|
@ -1023,29 +1022,18 @@ static int __init acpi_init(void)
|
|||
|
||||
init_acpi_device_notify();
|
||||
result = acpi_bus_init();
|
||||
|
||||
if (!result) {
|
||||
pci_mmcfg_late_init();
|
||||
if (pm_apm_enabled()) {
|
||||
printk(KERN_INFO PREFIX
|
||||
"APM is already active, exiting\n");
|
||||
disable_acpi();
|
||||
result = -ENODEV;
|
||||
} else {
|
||||
pm_set_acpi_flag();
|
||||
}
|
||||
} else
|
||||
if (result) {
|
||||
disable_acpi();
|
||||
|
||||
if (acpi_disabled)
|
||||
return result;
|
||||
}
|
||||
|
||||
pci_mmcfg_late_init();
|
||||
acpi_scan_init();
|
||||
acpi_ec_init();
|
||||
acpi_debugfs_init();
|
||||
acpi_sleep_proc_init();
|
||||
acpi_wakeup_device_init();
|
||||
return result;
|
||||
return 0;
|
||||
}
|
||||
|
||||
subsys_initcall(acpi_init);
|
||||
|
|
|
|||
Loading…
Reference in a new issue