参照元†
返り値†
/**
* pm_request_resume - Submit a resume request for given device.
* @dev: Device to resume.
*
* This function must be called under dev->power.lock with interrupts disabled.
*/
static int __pm_request_resume(struct device *dev)
{
int retval = 0;
if (dev->power.runtime_error)
return -EINVAL;
if (dev->power.runtime_status == RPM_ACTIVE)
retval = 1;
else if (dev->power.runtime_status == RPM_RESUMING)
retval = -EINPROGRESS;
else if (dev->power.disable_depth > 0)
retval = -EAGAIN;
if (retval < 0)
return retval;
pm_runtime_deactivate_timer(dev);
if (dev->power.runtime_status == RPM_SUSPENDING) {
dev->power.deferred_resume = true;
return retval;
}
if (dev->power.request_pending) {
/* If non-resume request is pending, we can overtake it. */
dev->power.request = retval ? RPM_REQ_NONE : RPM_REQ_RESUME;
return retval;
}
if (retval)
return retval;
dev->power.request = RPM_REQ_RESUME;
dev->power.request_pending = true;
queue_work(pm_wq, &dev->power.work);
return retval;
}
コメント†