/* device_complete - Complete a PM transition for given device. @dev: Device to handle. @state: PM transition of the system being carried out.  */
static void device_complete(struct device *dev, pm_message_t state)
/* device_complete - Complete a PM transition for given device. @dev: Device to handle. @state: PM transition of the system being carried out.  */
static void device_complete(struct device *dev, pm_message_t state)
{
	down(&dev->sem);
	if (dev->class && dev->class->pm && dev->class->pm->complete) {
		pm_dev_dbg(dev, state, "completing class ");
		dev->class->pm->complete(dev);
	}
	if (dev->type && dev->type->pm && dev->type->pm->complete) {
		pm_dev_dbg(dev, state, "completing type ");
		dev->type->pm->complete(dev);
	}
	if (dev->bus && dev->bus->pm && dev->bus->pm->complete) {
		pm_dev_dbg(dev, state, "completing ");
		dev->bus->pm->complete(dev);
	}
	up(&dev->sem);
}