--- zzzz-none-000/linux-2.6.19.2/kernel/power/disk.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/kernel/power/disk.c 2007-01-11 07:38:19.000000000 +0000 @@ -71,7 +71,7 @@ static int prepare_processes(void) { - int error = 0; + int error; pm_prepare_console(); @@ -84,12 +84,6 @@ goto thaw; } - if (pm_disk_mode == PM_DISK_TESTPROC) { - printk("swsusp debug: Waiting for 5 seconds.\n"); - mdelay(5000); - goto thaw; - } - /* Free memory before shutting down devices. */ if (!(error = swsusp_shrink_memory())) return 0; @@ -126,21 +120,13 @@ if (error) return error; - if (pm_disk_mode == PM_DISK_TESTPROC) - return 0; - suspend_console(); error = device_suspend(PMSG_FREEZE); if (error) { resume_console(); printk("Some devices failed to suspend\n"); - goto Thaw; - } - - if (pm_disk_mode == PM_DISK_TEST) { - printk("swsusp debug: Waiting for 5 seconds.\n"); - mdelay(5000); - goto Done; + unprepare_processes(); + return error; } pr_debug("PM: snapshotting memory.\n"); @@ -157,17 +143,16 @@ power_down(pm_disk_mode); else { swsusp_free(); - goto Thaw; + unprepare_processes(); + return error; } - } else { + } else pr_debug("PM: Image restored successfully.\n"); - } swsusp_free(); Done: device_resume(); resume_console(); - Thaw: unprepare_processes(); return error; } @@ -264,8 +249,6 @@ [PM_DISK_PLATFORM] = "platform", [PM_DISK_SHUTDOWN] = "shutdown", [PM_DISK_REBOOT] = "reboot", - [PM_DISK_TEST] = "test", - [PM_DISK_TESTPROC] = "testproc", }; /** @@ -320,19 +303,17 @@ } } if (mode) { - if (mode == PM_DISK_SHUTDOWN || mode == PM_DISK_REBOOT || - mode == PM_DISK_TEST || mode == PM_DISK_TESTPROC) { + if (mode == PM_DISK_SHUTDOWN || mode == PM_DISK_REBOOT) pm_disk_mode = mode; - } else { + else { if (pm_ops && pm_ops->enter && (mode == pm_ops->pm_disk_mode)) pm_disk_mode = mode; else error = -EINVAL; } - } else { + } else error = -EINVAL; - } pr_debug("PM: suspend-to-disk mode set to '%s'\n", pm_disk_modes[mode]);