/* Use @work to get the device object the work is to be done for, determine what is to be done and execute the appropriate run-time PM function.  */
static void pm_runtime_work(struct work_struct *work)
/* Use @work to get the device object the work is to be done for, determine what is to be done and execute the appropriate run-time PM function.  */
static void pm_runtime_work(struct work_struct *work)
{
	struct device *dev = container_of(work, struct device, power.work);
	enum rpm_request req;
	spin_lock_irq(&dev->power.lock);
	if (!dev->power.request_pending)
		goto out;
	req = dev->power.request;
	dev->power.request = RPM_REQ_NONE;
	dev->power.request_pending = false;
	switch (req) {
	case RPM_REQ_NONE:
		break;
	case RPM_REQ_IDLE:
		__pm_runtime_idle(dev);
		break;
	case RPM_REQ_SUSPEND:
		__pm_runtime_suspend(dev, true);
		break;
	case RPM_REQ_RESUME:
		__pm_runtime_resume(dev, true);
		break;
	}
 out:
	spin_unlock_irq(&dev->power.lock);
}