device_suspend — Save state and stop all devices in system.
int device_suspend ( | pm_message_t | state) ; |
Walk the dpm_active list, call ->suspend
for each device, and move
it to the dpm_off list.
(For historical reasons, if it returns -EAGAIN, that used to mean
that the device would be called again with interrupts disabled.
These days, we use the “suspend_late
” callback for that, so we
print a warning and consider it an error).
If we get a different error, try and back out.
If we hit a failure with any of the devices, call device_resume
above to bring the suspended devices back to life.