/* cpuidle_register_governor - registers a governor @gov: the governor  */
int cpuidle_register_governor(struct cpuidle_governor *gov)
/* cpuidle_register_governor - registers a governor @gov: the governor  */
int cpuidle_register_governor(struct cpuidle_governor *gov)
{
	int ret = -EEXIST;
	if (!gov || !gov->select)
		return -EINVAL;
	mutex_lock(&cpuidle_lock);
	if (__cpuidle_find_governor(gov->name) == NULL) {
		ret = 0;
		list_add_tail(&gov->governor_list, &cpuidle_governors);
		if (!cpuidle_curr_governor ||
		    cpuidle_curr_governor->rating < gov->rating)
			cpuidle_switch_governor(gov);
	}
	mutex_unlock(&cpuidle_lock);
	return ret;
}