diff options
author | David Rientjes <rientjes@google.com> | 2012-11-10 16:48:33 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2012-11-14 18:15:19 -0500 |
commit | 99926a8cd36b6088448fec41aed4a3b5b05b3679 (patch) | |
tree | 465af9d65753fa9fdf75c37522d51958c57acec4 /include/acpi | |
parent | e5cc8ef31267317f3e177415c84e3f3602e5bfc9 (diff) |
ACPI / PM: Fix build problem related to acpi_target_system_state()
Commit b87b49cd0efd ("ACPI / PM: Move device PM functions related to sleep
states") declared acpi_target_system_state() for CONFIG_PM_SLEEP whereas
it is only defined for CONFIG_ACPI_SLEEP, resulting in the following link
error:
drivers/built-in.o: In function `acpi_pm_device_sleep_wake':
drivers/acpi/device_pm.c:342: undefined reference to `acpi_target_system_state'
drivers/built-in.o: In function `acpi_dev_suspend_late':
drivers/acpi/device_pm.c:501: undefined reference to `acpi_target_system_state'
drivers/built-in.o: In function `acpi_pm_device_sleep_state':
drivers/acpi/device_pm.c:221: undefined reference to `acpi_target_system_state'
Define it only for CONFIG_ACPI_SLEEP and fallback to a dummy definition
for other configs.
[rjw: The problem only occurs for exotic .configs in which
HIBERNATE_CALLBACKS is selected by XEN_SAVE_RESTORE and neither
SUSPEND nor HIBERNATION is set.]
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/acpi')
-rw-r--r-- | include/acpi/acpi_bus.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index bf8709a1844..80155fda517 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -470,11 +470,9 @@ static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) | |||
470 | #endif | 470 | #endif |
471 | 471 | ||
472 | #ifdef CONFIG_PM_SLEEP | 472 | #ifdef CONFIG_PM_SLEEP |
473 | u32 acpi_target_system_state(void); | ||
474 | int __acpi_device_sleep_wake(struct acpi_device *, u32, bool); | 473 | int __acpi_device_sleep_wake(struct acpi_device *, u32, bool); |
475 | int acpi_pm_device_sleep_wake(struct device *, bool); | 474 | int acpi_pm_device_sleep_wake(struct device *, bool); |
476 | #else | 475 | #else |
477 | static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; } | ||
478 | static inline int __acpi_device_sleep_wake(struct acpi_device *adev, | 476 | static inline int __acpi_device_sleep_wake(struct acpi_device *adev, |
479 | u32 target_state, bool enable) | 477 | u32 target_state, bool enable) |
480 | { | 478 | { |
@@ -486,6 +484,12 @@ static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) | |||
486 | } | 484 | } |
487 | #endif | 485 | #endif |
488 | 486 | ||
487 | #ifdef CONFIG_ACPI_SLEEP | ||
488 | u32 acpi_target_system_state(void); | ||
489 | #else | ||
490 | static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; } | ||
491 | #endif | ||
492 | |||
489 | static inline bool acpi_device_power_manageable(struct acpi_device *adev) | 493 | static inline bool acpi_device_power_manageable(struct acpi_device *adev) |
490 | { | 494 | { |
491 | return adev->flags.power_manageable; | 495 | return adev->flags.power_manageable; |