diff options
| author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-02-10 18:04:52 -0500 |
|---|---|---|
| committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-03-14 19:43:15 -0400 |
| commit | cd51e61cf4e8b220da37dc35e9c2dc2dc258b4de (patch) | |
| tree | f2cb7a54e59b0bc238ac14f226214e0fc0817891 | |
| parent | cb8f51bdadb7969139c2e39c2defd4cde98c1ea8 (diff) | |
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: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Len Brown <len.brown@intel.com>
| -rw-r--r-- | drivers/acpi/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/acpi/bus.c | 7 | ||||
| -rw-r--r-- | include/linux/suspend.h | 6 | ||||
| -rw-r--r-- | kernel/power/main.c | 12 |
4 files changed, 21 insertions, 5 deletions
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig index 2aa042a5da6d..3a17ca5fff6f 100644 --- a/drivers/acpi/Kconfig +++ b/drivers/acpi/Kconfig | |||
| @@ -7,7 +7,6 @@ menuconfig ACPI | |||
| 7 | depends on !IA64_HP_SIM | 7 | depends on !IA64_HP_SIM |
| 8 | depends on IA64 || X86 | 8 | depends on IA64 || X86 |
| 9 | depends on PCI | 9 | depends on PCI |
| 10 | depends on PM | ||
| 11 | select PNP | 10 | select PNP |
| 12 | default y | 11 | default y |
| 13 | help | 12 | help |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 7ced61f39492..973b0709972c 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
| @@ -40,6 +40,7 @@ | |||
| 40 | #include <acpi/acpi_bus.h> | 40 | #include <acpi/acpi_bus.h> |
| 41 | #include <acpi/acpi_drivers.h> | 41 | #include <acpi/acpi_drivers.h> |
| 42 | #include <linux/dmi.h> | 42 | #include <linux/dmi.h> |
| 43 | #include <linux/suspend.h> | ||
| 43 | 44 | ||
| 44 | #include "internal.h" | 45 | #include "internal.h" |
| 45 | 46 | ||
| @@ -1025,13 +1026,13 @@ static int __init acpi_init(void) | |||
| 1025 | 1026 | ||
| 1026 | if (!result) { | 1027 | if (!result) { |
| 1027 | pci_mmcfg_late_init(); | 1028 | pci_mmcfg_late_init(); |
| 1028 | if (!(pm_flags & PM_APM)) | 1029 | if (pm_apm_enabled()) { |
| 1029 | pm_flags |= PM_ACPI; | ||
| 1030 | else { | ||
| 1031 | printk(KERN_INFO PREFIX | 1030 | printk(KERN_INFO PREFIX |
| 1032 | "APM is already active, exiting\n"); | 1031 | "APM is already active, exiting\n"); |
| 1033 | disable_acpi(); | 1032 | disable_acpi(); |
| 1034 | result = -ENODEV; | 1033 | result = -ENODEV; |
| 1034 | } else { | ||
| 1035 | pm_set_acpi_flag(); | ||
| 1035 | } | 1036 | } |
| 1036 | } else | 1037 | } else |
| 1037 | disable_acpi(); | 1038 | disable_acpi(); |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 5a89e3612875..5e364db8a56a 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -272,6 +272,9 @@ extern int unregister_pm_notifier(struct notifier_block *nb); | |||
| 272 | register_pm_notifier(&fn##_nb); \ | 272 | register_pm_notifier(&fn##_nb); \ |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | extern bool pm_apm_enabled(void); | ||
| 276 | extern void pm_set_acpi_flag(void); | ||
| 277 | |||
| 275 | /* drivers/base/power/wakeup.c */ | 278 | /* drivers/base/power/wakeup.c */ |
| 276 | extern bool events_check_enabled; | 279 | extern bool events_check_enabled; |
| 277 | 280 | ||
| @@ -292,6 +295,9 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) | |||
| 292 | 295 | ||
| 293 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) | 296 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) |
| 294 | 297 | ||
| 298 | static inline bool pm_apm_enabled(void) { return false; } | ||
| 299 | static inline void pm_set_acpi_flag(void) {} | ||
| 300 | |||
| 295 | static inline bool pm_wakeup_pending(void) { return false; } | 301 | static inline bool pm_wakeup_pending(void) { return false; } |
| 296 | #endif /* !CONFIG_PM_SLEEP */ | 302 | #endif /* !CONFIG_PM_SLEEP */ |
| 297 | 303 | ||
diff --git a/kernel/power/main.c b/kernel/power/main.c index 701853042c28..b5405af48ddb 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -17,10 +17,20 @@ | |||
| 17 | 17 | ||
| 18 | DEFINE_MUTEX(pm_mutex); | 18 | DEFINE_MUTEX(pm_mutex); |
| 19 | 19 | ||
| 20 | #ifdef CONFIG_PM_SLEEP | ||
| 21 | |||
| 20 | unsigned int pm_flags; | 22 | unsigned int pm_flags; |
| 21 | EXPORT_SYMBOL(pm_flags); | 23 | EXPORT_SYMBOL(pm_flags); |
| 22 | 24 | ||
| 23 | #ifdef CONFIG_PM_SLEEP | 25 | bool pm_apm_enabled(void) |
| 26 | { | ||
| 27 | return !!(pm_flags & PM_APM); | ||
| 28 | } | ||
| 29 | |||
| 30 | void pm_set_acpi_flag(void) | ||
| 31 | { | ||
| 32 | pm_flags |= PM_ACPI; | ||
| 33 | } | ||
| 24 | 34 | ||
| 25 | /* Routines for PM-transition notifications */ | 35 | /* Routines for PM-transition notifications */ |
| 26 | 36 | ||
