[swsusp] fix printks and cleanups

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Fix error printing in swsusp.c: add loglevels and add very usefull
error information. Trivial cleanup for disk.c.

Signed-off-by: Pavel Machek <[email protected]>

---
commit 79b675b6cc9268d178b3c0a2af2e4f944c5fdf9b
tree d55af4281a8a491d2dd505604f6dc96d94e74cf3
parent 8972d0ff145879e53416ac77c4cd096fd3cfe227
author <pavel@amd.(none)> Tue, 12 Jul 2005 11:09:44 +0200
committer <pavel@amd.(none)> Tue, 12 Jul 2005 11:09:44 +0200

 kernel/power/disk.c   |    8 ++------
 kernel/power/swsusp.c |    3 ++-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/kernel/power/disk.c b/kernel/power/disk.c
--- a/kernel/power/disk.c
+++ b/kernel/power/disk.c
@@ -50,21 +50,17 @@ static void power_down(suspend_disk_meth
 	unsigned long flags;
 	int error = 0;
 
+	device_shutdown();
+	local_irq_save(flags);
 	switch(mode) {
 	case PM_DISK_PLATFORM:
-		device_shutdown();
-		local_irq_save(flags);
 		error = pm_ops->enter(PM_SUSPEND_DISK);
 		break;
 	case PM_DISK_SHUTDOWN:
 		printk("Powering off system\n");
-		device_shutdown();
-		local_irq_save(flags);
 		machine_power_off();
 		break;
 	case PM_DISK_REBOOT:
-		device_shutdown();
-		local_irq_save(flags);
 		machine_restart(NULL);
 		break;
 	}
diff --git a/kernel/power/swsusp.c b/kernel/power/swsusp.c
--- a/kernel/power/swsusp.c
+++ b/kernel/power/swsusp.c
@@ -991,6 +991,7 @@ int swsusp_suspend(void)
 	 * at resume time, and evil weirdness ensues.
 	 */
 	if ((error = device_power_down(PMSG_FREEZE))) {
+		printk(KERN_ERR "Some devices failed to power down, aborting suspend\n");
 		local_irq_enable();
 		return error;
 	}
@@ -1004,7 +1005,7 @@ int swsusp_suspend(void)
 
 	save_processor_state();
 	if ((error = swsusp_arch_suspend()))
-		printk("Error %d suspending\n", error);
+		printk(KERN_ERR "Error %d suspending\n", error);
 	/* Restore control flow magically appears here */
 	restore_processor_state();
 	BUG_ON (nr_copy_pages_check != nr_copy_pages);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux