Commit 09681a07 authored by Sebastian Andrzej Siewior's avatar Sebastian Andrzej Siewior Committed by Rafael J. Wysocki
Browse files

cpufreq: Replace deprecated CPU-hotplug functions



The functions get_online_cpus() and put_online_cpus() have been
deprecated during the CPU hotplug rework. They map directly to
cpus_read_lock() and cpus_read_unlock().

Replace deprecated CPU-hotplug functions with the official version.
The behavior remains unchanged.

Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent c500bee1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -163,9 +163,9 @@ static ssize_t store_cpb(struct cpufreq_policy *policy, const char *buf,
	if (ret || val > 1)
		return -EINVAL;

	get_online_cpus();
	cpus_read_lock();
	set_boost(policy, val);
	put_online_cpus();
	cpus_read_unlock();

	return count;
}
+3 −3
Original line number Diff line number Diff line
@@ -2654,18 +2654,18 @@ int cpufreq_boost_trigger_state(int state)
	cpufreq_driver->boost_enabled = state;
	write_unlock_irqrestore(&cpufreq_driver_lock, flags);

	get_online_cpus();
	cpus_read_lock();
	for_each_active_policy(policy) {
		ret = cpufreq_driver->set_boost(policy, state);
		if (ret)
			goto err_reset_state;
	}
	put_online_cpus();
	cpus_read_unlock();

	return 0;

err_reset_state:
	put_online_cpus();
	cpus_read_unlock();

	write_lock_irqsave(&cpufreq_driver_lock, flags);
	cpufreq_driver->boost_enabled = !state;
+2 −2
Original line number Diff line number Diff line
@@ -418,7 +418,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias)
	default_powersave_bias = powersave_bias;
	cpumask_clear(&done);

	get_online_cpus();
	cpus_read_lock();
	for_each_online_cpu(cpu) {
		struct cpufreq_policy *policy;
		struct policy_dbs_info *policy_dbs;
@@ -442,7 +442,7 @@ static void od_set_powersave_bias(unsigned int powersave_bias)
		od_tuners = dbs_data->tuners;
		od_tuners->powersave_bias = default_powersave_bias;
	}
	put_online_cpus();
	cpus_read_unlock();
}

void od_register_powersave_bias_handler(unsigned int (*f)
+2 −2
Original line number Diff line number Diff line
@@ -2969,7 +2969,7 @@ static void intel_pstate_driver_cleanup(void)
{
	unsigned int cpu;

	get_online_cpus();
	cpus_read_lock();
	for_each_online_cpu(cpu) {
		if (all_cpu_data[cpu]) {
			if (intel_pstate_driver == &intel_pstate)
@@ -2979,7 +2979,7 @@ static void intel_pstate_driver_cleanup(void)
			all_cpu_data[cpu] = NULL;
		}
	}
	put_online_cpus();
	cpus_read_unlock();

	intel_pstate_driver = NULL;
}
+3 −3
Original line number Diff line number Diff line
@@ -1180,7 +1180,7 @@ static int powernowk8_init(void)
	if (!x86_match_cpu(powernow_k8_ids))
		return -ENODEV;

	get_online_cpus();
	cpus_read_lock();
	for_each_online_cpu(i) {
		smp_call_function_single(i, check_supported_cpu, &ret, 1);
		if (!ret)
@@ -1188,10 +1188,10 @@ static int powernowk8_init(void)
	}

	if (supported_cpus != num_online_cpus()) {
		put_online_cpus();
		cpus_read_unlock();
		return -ENODEV;
	}
	put_online_cpus();
	cpus_read_unlock();

	ret = cpufreq_register_driver(&cpufreq_amd64_driver);
	if (ret)
Loading