Commit c7282dce authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

cpufreq: Drop cpufreq_cpu_acquire() and cpufreq_cpu_release()



Since cpufreq_cpu_acquire() and cpufreq_cpu_release() have no more
users in the tree, remove them.

No intentional functional impact.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@amd.com>
Acked-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Tested-by: default avatarSudeep Holla <sudeep.holla@arm.com>
Link: https://patch.msgid.link/3880470.kQq0lBPeGt@rjwysocki.net
parent 9a74bfdf
Loading
Loading
Loading
Loading
+0 −45
Original line number Diff line number Diff line
@@ -255,51 +255,6 @@ void cpufreq_cpu_put(struct cpufreq_policy *policy)
}
EXPORT_SYMBOL_GPL(cpufreq_cpu_put);

/**
 * cpufreq_cpu_release - Unlock a policy and decrement its usage counter.
 * @policy: cpufreq policy returned by cpufreq_cpu_acquire().
 */
void cpufreq_cpu_release(struct cpufreq_policy *policy)
{
	if (WARN_ON(!policy))
		return;

	lockdep_assert_held(&policy->rwsem);

	up_write(&policy->rwsem);

	cpufreq_cpu_put(policy);
}

/**
 * cpufreq_cpu_acquire - Find policy for a CPU, mark it as busy and lock it.
 * @cpu: CPU to find the policy for.
 *
 * Call cpufreq_cpu_get() to get a reference on the cpufreq policy for @cpu and
 * if the policy returned by it is not NULL, acquire its rwsem for writing.
 * Return the policy if it is active or release it and return NULL otherwise.
 *
 * The policy returned by this function has to be released with the help of
 * cpufreq_cpu_release() in order to release its rwsem and balance its usage
 * counter properly.
 */
struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu)
{
	struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);

	if (!policy)
		return NULL;

	down_write(&policy->rwsem);

	if (policy_is_inactive(policy)) {
		cpufreq_cpu_release(policy);
		return NULL;
	}

	return policy;
}

/*********************************************************************
 *            EXTERNALLY AFFECTING FREQUENCY CHANGES                 *
 *********************************************************************/
+0 −2
Original line number Diff line number Diff line
@@ -241,8 +241,6 @@ void disable_cpufreq(void);

u64 get_cpu_idle_time(unsigned int cpu, u64 *wall, int io_busy);

struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu);
void cpufreq_cpu_release(struct cpufreq_policy *policy);
int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
void refresh_frequency_limits(struct cpufreq_policy *policy);
void cpufreq_update_policy(unsigned int cpu);