Skip to content

Commit c7282dc

Browse files
committed
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: Rafael J. Wysocki <[email protected]> Acked-by: Viresh Kumar <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Acked-by: Sudeep Holla <[email protected]> Tested-by: Sudeep Holla <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 9a74bfd commit c7282dc

File tree

2 files changed

+0
-47
lines changed

2 files changed

+0
-47
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -255,51 +255,6 @@ void cpufreq_cpu_put(struct cpufreq_policy *policy)
255255
}
256256
EXPORT_SYMBOL_GPL(cpufreq_cpu_put);
257257

258-
/**
259-
* cpufreq_cpu_release - Unlock a policy and decrement its usage counter.
260-
* @policy: cpufreq policy returned by cpufreq_cpu_acquire().
261-
*/
262-
void cpufreq_cpu_release(struct cpufreq_policy *policy)
263-
{
264-
if (WARN_ON(!policy))
265-
return;
266-
267-
lockdep_assert_held(&policy->rwsem);
268-
269-
up_write(&policy->rwsem);
270-
271-
cpufreq_cpu_put(policy);
272-
}
273-
274-
/**
275-
* cpufreq_cpu_acquire - Find policy for a CPU, mark it as busy and lock it.
276-
* @cpu: CPU to find the policy for.
277-
*
278-
* Call cpufreq_cpu_get() to get a reference on the cpufreq policy for @cpu and
279-
* if the policy returned by it is not NULL, acquire its rwsem for writing.
280-
* Return the policy if it is active or release it and return NULL otherwise.
281-
*
282-
* The policy returned by this function has to be released with the help of
283-
* cpufreq_cpu_release() in order to release its rwsem and balance its usage
284-
* counter properly.
285-
*/
286-
struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu)
287-
{
288-
struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
289-
290-
if (!policy)
291-
return NULL;
292-
293-
down_write(&policy->rwsem);
294-
295-
if (policy_is_inactive(policy)) {
296-
cpufreq_cpu_release(policy);
297-
return NULL;
298-
}
299-
300-
return policy;
301-
}
302-
303258
/*********************************************************************
304259
* EXTERNALLY AFFECTING FREQUENCY CHANGES *
305260
*********************************************************************/

include/linux/cpufreq.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ void disable_cpufreq(void);
241241

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

244-
struct cpufreq_policy *cpufreq_cpu_acquire(unsigned int cpu);
245-
void cpufreq_cpu_release(struct cpufreq_policy *policy);
246244
int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
247245
void refresh_frequency_limits(struct cpufreq_policy *policy);
248246
void cpufreq_update_policy(unsigned int cpu);

0 commit comments

Comments
 (0)