Make suspend abort reason logging depend on CONFIG_PM_SLEEP
[firefly-linux-kernel-4.4.55.git] / kernel / power / process.c
index 37eac4066e7131037be32ed7cbb26a87d2bca4c9..e7f1f736a5b6344f7bc0aef53b71e8ebf9caf034 100644 (file)
@@ -36,7 +36,9 @@ static int try_to_freeze_tasks(bool user_only)
        unsigned int elapsed_msecs;
        bool wakeup = false;
        int sleep_usecs = USEC_PER_MSEC;
+#ifdef CONFIG_PM_SLEEP
        char suspend_abort[MAX_SUSPEND_ABORT_LEN];
+#endif
 
        do_gettimeofday(&start);
 
@@ -66,9 +68,11 @@ static int try_to_freeze_tasks(bool user_only)
                        break;
 
                if (pm_wakeup_pending()) {
+#ifdef CONFIG_PM_SLEEP
                        pm_get_active_wakeup_sources(suspend_abort,
                                MAX_SUSPEND_ABORT_LEN);
                        log_suspend_abort_reason(suspend_abort);
+#endif
                        wakeup = true;
                        break;
                }