Skip to content

Commit 2e41e3c

Browse files
khfengrafaeljw
authored andcommitted
PM: suspend: Fix pm_suspend_target_state handling for !CONFIG_PM
Move the pm_suspend_target_state definition for CONFIG_SUSPEND unset from the wakeup code into the headers so as to allow it to still be used elsewhere when CONFIG_SUSPEND is not set. Signed-off-by: Kai-Heng Feng <[email protected]> [ rjw: Changelog and subject edits ] Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 44c026a commit 2e41e3c

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

drivers/base/power/wakeup.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@
1919

2020
#include "power.h"
2121

22-
#ifndef CONFIG_SUSPEND
23-
suspend_state_t pm_suspend_target_state;
24-
#define pm_suspend_target_state (PM_SUSPEND_ON)
25-
#endif
26-
2722
#define list_for_each_entry_rcu_locked(pos, head, member) \
2823
list_for_each_entry_rcu(pos, head, member, \
2924
srcu_read_lock_held(&wakeup_srcu))

include/linux/suspend.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ struct platform_s2idle_ops {
202202
};
203203

204204
#ifdef CONFIG_SUSPEND
205+
extern suspend_state_t pm_suspend_target_state;
205206
extern suspend_state_t mem_sleep_current;
206207
extern suspend_state_t mem_sleep_default;
207208

@@ -337,6 +338,8 @@ extern bool sync_on_suspend_enabled;
337338
#else /* !CONFIG_SUSPEND */
338339
#define suspend_valid_only_mem NULL
339340

341+
#define pm_suspend_target_state (PM_SUSPEND_ON)
342+
340343
static inline void pm_suspend_clear_flags(void) {}
341344
static inline void pm_set_suspend_via_firmware(void) {}
342345
static inline void pm_set_resume_via_firmware(void) {}
@@ -503,7 +506,6 @@ extern void pm_report_max_hw_sleep(u64 t);
503506

504507
/* drivers/base/power/wakeup.c */
505508
extern bool events_check_enabled;
506-
extern suspend_state_t pm_suspend_target_state;
507509

508510
extern bool pm_wakeup_pending(void);
509511
extern void pm_system_wakeup(void);

0 commit comments

Comments
 (0)