Skip to content

Commit 589a7c4

Browse files
committed
cpufreq: Drop unused cpufreq_get_policy()
A recent change has introduced a bug into cpufreq_get_policy(), but this function is not used, so it's better to drop it altogether. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Viresh Kumar <[email protected]> Acked-by: Sudeep Holla <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent eaff6b6 commit 589a7c4

File tree

2 files changed

+0
-26
lines changed

2 files changed

+0
-26
lines changed

drivers/cpufreq/cpufreq.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2549,31 +2549,6 @@ EXPORT_SYMBOL_GPL(cpufreq_unregister_governor);
25492549
* POLICY INTERFACE *
25502550
*********************************************************************/
25512551

2552-
/**
2553-
* cpufreq_get_policy - get the current cpufreq_policy
2554-
* @policy: struct cpufreq_policy into which the current cpufreq_policy
2555-
* is written
2556-
* @cpu: CPU to find the policy for
2557-
*
2558-
* Reads the current cpufreq policy.
2559-
*/
2560-
int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu)
2561-
{
2562-
struct cpufreq_policy *cpu_policy __free(put_cpufreq_policy);
2563-
2564-
if (!policy)
2565-
return -EINVAL;
2566-
2567-
cpu_policy = cpufreq_cpu_get(cpu);
2568-
if (!cpu_policy)
2569-
return -EINVAL;
2570-
2571-
memcpy(policy, cpu_policy, sizeof(*policy));
2572-
2573-
return 0;
2574-
}
2575-
EXPORT_SYMBOL(cpufreq_get_policy);
2576-
25772552
DEFINE_PER_CPU(unsigned long, cpufreq_pressure);
25782553

25792554
/**

include/linux/cpufreq.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ void disable_cpufreq(void);
241241

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

244-
int cpufreq_get_policy(struct cpufreq_policy *policy, unsigned int cpu);
245244
void refresh_frequency_limits(struct cpufreq_policy *policy);
246245
void cpufreq_update_policy(unsigned int cpu);
247246
void cpufreq_update_limits(unsigned int cpu);

0 commit comments

Comments
 (0)