PM: Clear -EAGAIN in dpm_prepare
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Wed, 8 Jul 2009 11:26:05 +0000 (13:26 +0200)
committerRafael J. Wysocki <rjw@sisk.pl>
Wed, 8 Jul 2009 11:26:05 +0000 (13:26 +0200)
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>
drivers/base/power/main.c

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