/* Return value: 1, if there was a resume request pending and the device had to be woken up, 0, otherwise  */
int pm_runtime_barrier(struct device *dev)
/* Return value: 1, if there was a resume request pending and the device had to be woken up, 0, otherwise  */
int pm_runtime_barrier(struct device *dev)
{
	int retval = 0;
	pm_runtime_get_noresume(dev);
	spin_lock_irq(&dev->power.lock);
	if (dev->power.request_pending
	    && dev->power.request == RPM_REQ_RESUME) {
		__pm_runtime_resume(dev, false);
		retval = 1;
	}
	__pm_runtime_barrier(dev);
	spin_unlock_irq(&dev->power.lock);
	pm_runtime_put_noidle(dev);
	return retval;
}