Commit cd51e61c authored by Rafael J. Wysocki's avatar Rafael J. Wysocki

PM / ACPI: Remove references to pm_flags from bus.c

If direct references to pm_flags are removed from drivers/acpi/bus.c,
CONFIG_ACPI will not need to depend on CONFIG_PM any more.  Make that
happen.
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
Acked-by: default avatarLen Brown <len.brown@intel.com>
parent cb8f51bd
...@@ -7,7 +7,6 @@ menuconfig ACPI ...@@ -7,7 +7,6 @@ menuconfig ACPI
depends on !IA64_HP_SIM depends on !IA64_HP_SIM
depends on IA64 || X86 depends on IA64 || X86
depends on PCI depends on PCI
depends on PM
select PNP select PNP
default y default y
help help
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <acpi/acpi_bus.h> #include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h> #include <acpi/acpi_drivers.h>
#include <linux/dmi.h> #include <linux/dmi.h>
#include <linux/suspend.h>
#include "internal.h" #include "internal.h"
...@@ -1025,13 +1026,13 @@ static int __init acpi_init(void) ...@@ -1025,13 +1026,13 @@ static int __init acpi_init(void)
if (!result) { if (!result) {
pci_mmcfg_late_init(); pci_mmcfg_late_init();
if (!(pm_flags & PM_APM)) if (pm_apm_enabled()) {
pm_flags |= PM_ACPI;
else {
printk(KERN_INFO PREFIX printk(KERN_INFO PREFIX
"APM is already active, exiting\n"); "APM is already active, exiting\n");
disable_acpi(); disable_acpi();
result = -ENODEV; result = -ENODEV;
} else {
pm_set_acpi_flag();
} }
} else } else
disable_acpi(); disable_acpi();
......
...@@ -272,6 +272,9 @@ extern int unregister_pm_notifier(struct notifier_block *nb); ...@@ -272,6 +272,9 @@ extern int unregister_pm_notifier(struct notifier_block *nb);
register_pm_notifier(&fn##_nb); \ register_pm_notifier(&fn##_nb); \
} }
extern bool pm_apm_enabled(void);
extern void pm_set_acpi_flag(void);
/* drivers/base/power/wakeup.c */ /* drivers/base/power/wakeup.c */
extern bool events_check_enabled; extern bool events_check_enabled;
...@@ -292,6 +295,9 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) ...@@ -292,6 +295,9 @@ static inline int unregister_pm_notifier(struct notifier_block *nb)
#define pm_notifier(fn, pri) do { (void)(fn); } while (0) #define pm_notifier(fn, pri) do { (void)(fn); } while (0)
static inline bool pm_apm_enabled(void) { return false; }
static inline void pm_set_acpi_flag(void) {}
static inline bool pm_wakeup_pending(void) { return false; } static inline bool pm_wakeup_pending(void) { return false; }
#endif /* !CONFIG_PM_SLEEP */ #endif /* !CONFIG_PM_SLEEP */
......
...@@ -17,10 +17,20 @@ ...@@ -17,10 +17,20 @@
DEFINE_MUTEX(pm_mutex); DEFINE_MUTEX(pm_mutex);
#ifdef CONFIG_PM_SLEEP
unsigned int pm_flags; unsigned int pm_flags;
EXPORT_SYMBOL(pm_flags); EXPORT_SYMBOL(pm_flags);
#ifdef CONFIG_PM_SLEEP bool pm_apm_enabled(void)
{
return !!(pm_flags & PM_APM);
}
void pm_set_acpi_flag(void)
{
pm_flags |= PM_ACPI;
}
/* Routines for PM-transition notifications */ /* Routines for PM-transition notifications */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment