瀏覽代碼

PM: Clear -EAGAIN in dpm_prepare

When the last device in the dpm list is unregistered directly after its
prepare() callback returned with -EAGAIN, the return code is passed to
the calling function, resulting in a suspend failure. Prevent this by
clearing the return code after -EAGAIN.

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Sebastian Ott 16 年之前
父節點
當前提交
886a7a3371
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/base/power/main.c

+ 1 - 0
drivers/base/power/main.c

@@ -762,6 +762,7 @@ static int dpm_prepare(pm_message_t state)
 			dev->power.status = DPM_ON;
 			dev->power.status = DPM_ON;
 			if (error == -EAGAIN) {
 			if (error == -EAGAIN) {
 				put_device(dev);
 				put_device(dev);
+				error = 0;
 				continue;
 				continue;
 			}
 			}
 			printk(KERN_ERR "PM: Failed to prepare device %s "
 			printk(KERN_ERR "PM: Failed to prepare device %s "