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>
This commit is contained in:
parent
e5cc8ef312
commit
99926a8cd3
1 changed files with 6 additions and 2 deletions
|
@ -470,11 +470,9 @@ static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
u32 acpi_target_system_state(void);
|
|
||||||
int __acpi_device_sleep_wake(struct acpi_device *, u32, bool);
|
int __acpi_device_sleep_wake(struct acpi_device *, u32, bool);
|
||||||
int acpi_pm_device_sleep_wake(struct device *, bool);
|
int acpi_pm_device_sleep_wake(struct device *, bool);
|
||||||
#else
|
#else
|
||||||
static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; }
|
|
||||||
static inline int __acpi_device_sleep_wake(struct acpi_device *adev,
|
static inline int __acpi_device_sleep_wake(struct acpi_device *adev,
|
||||||
u32 target_state, bool enable)
|
u32 target_state, bool enable)
|
||||||
{
|
{
|
||||||
|
@ -486,6 +484,12 @@ static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_ACPI_SLEEP
|
||||||
|
u32 acpi_target_system_state(void);
|
||||||
|
#else
|
||||||
|
static inline u32 acpi_target_system_state(void) { return ACPI_STATE_S0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline bool acpi_device_power_manageable(struct acpi_device *adev)
|
static inline bool acpi_device_power_manageable(struct acpi_device *adev)
|
||||||
{
|
{
|
||||||
return adev->flags.power_manageable;
|
return adev->flags.power_manageable;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue