freezer: clean up freeze_processes() failure path
[firefly-linux-kernel-4.4.55.git] / kernel / power / suspend.c
index fdd4263b995d4c1e15f26188b3dacf47d30dec08..d336b27d1104fb5aa7aceff18c1742166325cf6d 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/init.h>
+#include <linux/kmod.h>
 #include <linux/console.h>
 #include <linux/cpu.h>
 #include <linux/syscalls.h>
@@ -21,6 +22,7 @@
 #include <linux/list.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
+#include <linux/export.h>
 #include <linux/suspend.h>
 #include <linux/syscore_ops.h>
 #include <trace/events/power.h>
@@ -104,13 +106,11 @@ static int suspend_prepare(void)
                goto Finish;
 
        error = suspend_freeze_processes();
-       if (error) {
-               suspend_stats.failed_freeze++;
-               dpm_save_failed_step(SUSPEND_FREEZE);
-       } else
+       if (!error)
                return 0;
 
-       suspend_thaw_processes();
+       suspend_stats.failed_freeze++;
+       dpm_save_failed_step(SUSPEND_FREEZE);
        usermodehelper_enable();
  Finish:
        pm_notifier_call_chain(PM_POST_SUSPEND);