Commit 0569d1c8 authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[CPUFREQ] remove double calls to module_get/put in userspace governor

The cpufreq core properly gets and puts the modules it calls, including
governors. So there's no need to keep the racy in-module calls in
cpufreq_userspace denoting otherwise.
Signed-off-by: default avatarDominik Brodowski <linux@brodo.de>
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent 44baef18
......@@ -515,7 +515,7 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
unsigned int cpu = policy->cpu;
switch (event) {
case CPUFREQ_GOV_START:
if ((!cpu_online(cpu)) || (!try_module_get(THIS_MODULE)))
if (!cpu_online(cpu))
return -EINVAL;
BUG_ON(!policy->cur);
down(&userspace_sem);
......@@ -534,7 +534,6 @@ static int cpufreq_governor_userspace(struct cpufreq_policy *policy,
cpu_max_freq[cpu] = 0;
sysfs_remove_file (&policy->kobj, &freq_attr_scaling_setspeed.attr);
up(&userspace_sem);
module_put(THIS_MODULE);
break;
case CPUFREQ_GOV_LIMITS:
down(&userspace_sem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment