/* Execute the ->complete() callbacks for all devices whose PM status is not DPM_ON (this allows new devices to be registered).  */
static void dpm_complete(pm_message_t state)
/* Execute the ->complete() callbacks for all devices whose PM status is not DPM_ON (this allows new devices to be registered).  */
static void dpm_complete(pm_message_t state)
{
	struct list_head list;
	INIT_LIST_HEAD(&list);
	mutex_lock(&dpm_list_mtx);
	transition_started = false;
	while (!list_empty(&dpm_list)) {
		struct device *dev = to_device(dpm_list.prev);
		get_device(dev);
		if (dev->power.status > DPM_ON) {
			dev->power.status = DPM_ON;
			mutex_unlock(&dpm_list_mtx);
			device_complete(dev, state);
			pm_runtime_put_sync(dev);
			mutex_lock(&dpm_list_mtx);
		}
		if (!list_empty(&dev->power.entry))
			list_move(&dev->power.entry, &list);
		put_device(dev);
	}
	list_splice(&list, &dpm_list);
	mutex_unlock(&dpm_list_mtx);
}