diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-02-15 15:22:24 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-03-14 19:43:16 -0400 |
commit | 6831c6edc7b272a08dd2a6c71bb183a48fe98ae6 (patch) | |
tree | fc3ef253f12bd9f2d211271c09a5475ed19b18b0 /drivers/acpi | |
parent | e8665002477f0278f84f898145b1f141ba26ee26 (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 'drivers/acpi')
-rw-r--r-- | drivers/acpi/bus.c | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 973b0709972c..9749980ca6ca 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -1007,8 +1007,7 @@ struct kobject *acpi_kobj; | |||
1007 | 1007 | ||
1008 | static int __init acpi_init(void) | 1008 | static int __init acpi_init(void) |
1009 | { | 1009 | { |
1010 | int result = 0; | 1010 | int result; |
1011 | |||
1012 | 1011 | ||
1013 | if (acpi_disabled) { | 1012 | if (acpi_disabled) { |
1014 | printk(KERN_INFO PREFIX "Interpreter disabled.\n"); | 1013 | printk(KERN_INFO PREFIX "Interpreter disabled.\n"); |
@@ -1023,29 +1022,18 @@ static int __init acpi_init(void) | |||
1023 | 1022 | ||
1024 | init_acpi_device_notify(); | 1023 | init_acpi_device_notify(); |
1025 | result = acpi_bus_init(); | 1024 | result = acpi_bus_init(); |
1026 | 1025 | if (result) { | |
1027 | if (!result) { | ||
1028 | pci_mmcfg_late_init(); | ||
1029 | if (pm_apm_enabled()) { | ||
1030 | printk(KERN_INFO PREFIX | ||
1031 | "APM is already active, exiting\n"); | ||
1032 | disable_acpi(); | ||
1033 | result = -ENODEV; | ||
1034 | } else { | ||
1035 | pm_set_acpi_flag(); | ||
1036 | } | ||
1037 | } else | ||
1038 | disable_acpi(); | 1026 | disable_acpi(); |
1039 | |||
1040 | if (acpi_disabled) | ||
1041 | return result; | 1027 | return result; |
1028 | } | ||
1042 | 1029 | ||
1030 | pci_mmcfg_late_init(); | ||
1043 | acpi_scan_init(); | 1031 | acpi_scan_init(); |
1044 | acpi_ec_init(); | 1032 | acpi_ec_init(); |
1045 | acpi_debugfs_init(); | 1033 | acpi_debugfs_init(); |
1046 | acpi_sleep_proc_init(); | 1034 | acpi_sleep_proc_init(); |
1047 | acpi_wakeup_device_init(); | 1035 | acpi_wakeup_device_init(); |
1048 | return result; | 1036 | return 0; |
1049 | } | 1037 | } |
1050 | 1038 | ||
1051 | subsys_initcall(acpi_init); | 1039 | subsys_initcall(acpi_init); |