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: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Len Brown <len.brown@intel.com>
depends on !IA64_HP_SIM
depends on IA64 || X86
depends on PCI
- depends on PM
select PNP
default y
help
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/dmi.h>
+#include <linux/suspend.h>
#include "internal.h"
if (!result) {
pci_mmcfg_late_init();
- if (!(pm_flags & PM_APM))
- pm_flags |= PM_ACPI;
- else {
+ if (pm_apm_enabled()) {
printk(KERN_INFO PREFIX
"APM is already active, exiting\n");
disable_acpi();
result = -ENODEV;
+ } else {
+ pm_set_acpi_flag();
}
} else
disable_acpi();
register_pm_notifier(&fn##_nb); \
}
+extern bool pm_apm_enabled(void);
+extern void pm_set_acpi_flag(void);
+
/* drivers/base/power/wakeup.c */
extern bool events_check_enabled;
#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; }
#endif /* !CONFIG_PM_SLEEP */
DEFINE_MUTEX(pm_mutex);
+#ifdef CONFIG_PM_SLEEP
+
unsigned int 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 */