Skip to content

Commit

Permalink
power: suspend: Fix undefined resleep_work issue
Browse files Browse the repository at this point in the history
When PM_RESLEEP_LOCK is not enabled, there is no resleep_work defined,
causing compile error. Simply flag the related code.

Signed-off-by: Loic Poulain <[email protected]>
  • Loading branch information
Loic Poulain authored and mkemlogic committed Aug 31, 2022
1 parent 5a80528 commit 89aacfd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/power/suspend.c
Original file line number Diff line number Diff line change
Expand Up @@ -410,11 +410,13 @@ static int suspend_prepare(suspend_state_t state)
__pm_notifier_call_chain(PM_POST_SUSPEND, nr_calls, NULL);
pm_restore_console();

#ifdef CONFIG_PM_RESLEEP_LOCK
/* resleep_isok() takes a lock and we need to release it in case of error
* since suspend_finish() will not be called...
*/
if (error)
resleep_unlock(&resleep_work.work);
#endif

return error;
}
Expand Down

0 comments on commit 89aacfd

Please sign in to comment.