Skip to contentSkip to conversation

PM: check sysdev_suspend(PMSG_FREEZE) return value

PATCH In review Bjorn Helgaas 3 participants 3 messages May 15, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PM: check sysdev_suspend(PMSG_FREEZE) return value

Check the return value of sysdev_suspend(). I think this was a typo. Without this change, the following "if" check is always false. I also changed the error message so it's distinguishable from the similar message a few lines above.

---
 kernel/power/disk.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/power/disk.c +2 -2
index 2616832..6674722 100644
@@ -242,9 +242,9 @@ static int create_image(int platform_mode)
 
 	local_irq_disable();
 
-	sysdev_suspend(PMSG_FREEZE);
+	error = sysdev_suspend(PMSG_FREEZE);
 	if (error) {
-		printk(KERN_ERR "PM: Some devices failed to power down, "
+		printk(KERN_ERR "PM: Some system devices failed to power down, "
 			"aborting hibernation\n");
 		goto Enable_irqs;
 	}
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Bjorn Helgaas

Check the return value of sysdev_suspend(). I think this was a typo. Without this change, the following "if" check is always false. I also changed the error message so it's distinguishable from the similar message a few lines above.

Quoted 20 lines
---
 kernel/power/disk.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/power/disk.c +2 -2
index 2616832..6674722 100644
@@ -242,9 +242,9 @@ static int create_image(int platform_mode)
 
 	local_irq_disable();
 
-	sysdev_suspend(PMSG_FREEZE);
+	error = sysdev_suspend(PMSG_FREEZE);
 	if (error) {
-		printk(KERN_ERR "PM: Some devices failed to power down, "
+		printk(KERN_ERR "PM: Some system devices failed to power down, "
 			"aborting hibernation\n");
 		goto Enable_irqs;
 	}
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#2 lore raw
In reply to Bjorn Helgaas
Quoted 1 line · Bjorn Helgaas

Check the return value of sysdev_suspend(). I think this was a typo.

Yes, it was, good catch!

I'm going to push that to Linus for .30.

Quoted 3 lines

Without this change, the following "if" check is always false. I also changed the error message so it's distinguishable from the similar message a few lines above.

Thanks,
Rafael

Quoted 22 lines
---
 kernel/power/disk.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kernel/power/disk.c +2 -2
index 2616832..6674722 100644
@@ -242,9 +242,9 @@ static int create_image(int platform_mode)
 
 	local_irq_disable();
 
-	sysdev_suspend(PMSG_FREEZE);
+	error = sysdev_suspend(PMSG_FREEZE);
 	if (error) {
-		printk(KERN_ERR "PM: Some devices failed to power down, "
+		printk(KERN_ERR "PM: Some system devices failed to power down, "
 			"aborting hibernation\n");
 		goto Enable_irqs;
 	}