diff mbox

Async suspend-resume patch w/ completions (was: Re: Async suspend-resume patch w/ rwsems)

Message ID alpine.LFD.2.00.0912101538250.3560@localhost.localdomain (mailing list archive)
State RFC, archived
Headers show

Commit Message

Linus Torvalds Dec. 10, 2009, 11:51 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 8aa2443..f2bb493 100644
--- a/drivers/base/power/main.c
+++ b/drivers/base/power/main.c
@@ -687,6 +687,7 @@  static int dpm_suspend(pm_message_t state)
 		struct device *dev = to_device(dpm_list.prev);
 
 		get_device(dev);
+		list_move(&dev->power.entry, &list);
 		mutex_unlock(&dpm_list_mtx);
 
 		error = device_suspend(dev, state);
@@ -698,8 +699,6 @@  static int dpm_suspend(pm_message_t state)
 			break;
 		}
 		dev->power.status = DPM_OFF;
-		if (!list_empty(&dev->power.entry))
-			list_move(&dev->power.entry, &list);
 		put_device(dev);
 	}
 	list_splice(&list, dpm_list.prev);