]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - kernel/power/suspend.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into rmobile-fixes...
[mv-sheeva.git] / kernel / power / suspend.c
index fdd4263b995d4c1e15f26188b3dacf47d30dec08..4fd51beed87955f938f7b6545e49ffec0430da56 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>
@@ -40,9 +42,9 @@ static const struct platform_suspend_ops *suspend_ops;
  */
 void suspend_set_ops(const struct platform_suspend_ops *ops)
 {
-       mutex_lock(&pm_mutex);
+       lock_system_sleep();
        suspend_ops = ops;
-       mutex_unlock(&pm_mutex);
+       unlock_system_sleep();
 }
 EXPORT_SYMBOL_GPL(suspend_set_ops);
 
@@ -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);