Commit 886a7a33 authored by Sebastian Ott's avatar Sebastian Ott Committed by Rafael J. Wysocki

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: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
parent 00024be9
...@@ -762,6 +762,7 @@ static int dpm_prepare(pm_message_t state) ...@@ -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 "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment