diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-07-08 07:26:05 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2009-07-08 07:26:05 -0400 |
commit | 886a7a3371da8ee46a13f8e598a536bd8765b837 (patch) | |
tree | 5b6b9fb297cc3f59cd1777548e2fa82d4e1bb5f9 /drivers/base | |
parent | 00024be9689963c55cf2ab10ce3fb4502016c09a (diff) |
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>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/main.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index fae725458981..58a3e572f2c9 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -762,6 +762,7 @@ static int dpm_prepare(pm_message_t state) | |||
762 | dev->power.status = DPM_ON; | 762 | dev->power.status = DPM_ON; |
763 | if (error == -EAGAIN) { | 763 | if (error == -EAGAIN) { |
764 | put_device(dev); | 764 | put_device(dev); |
765 | error = 0; | ||
765 | continue; | 766 | continue; |
766 | } | 767 | } |
767 | printk(KERN_ERR "PM: Failed to prepare device %s " | 768 | printk(KERN_ERR "PM: Failed to prepare device %s " |