/* cpuidle_unregister_device - unregisters a CPU's idle PM feature @dev: the cpu  */
void cpuidle_unregister_device(struct cpuidle_device *dev)
/* cpuidle_unregister_device - unregisters a CPU's idle PM feature @dev: the cpu  */
void cpuidle_unregister_device(struct cpuidle_device *dev)
{
	struct sys_device *sys_dev = get_cpu_sysdev((unsigned long)dev->cpu);
	if (dev->registered == 0)
		return;
	cpuidle_pause_and_lock();
	cpuidle_disable_device(dev);
	cpuidle_remove_sysfs(sys_dev);
	list_del(&dev->device_list);
	wait_for_completion(&dev->kobj_unregister);
	per_cpu(cpuidle_devices, dev->cpu) = NULL;
	cpuidle_resume_and_unlock();
	module_put(cpuidle_curr_driver->owner);
}