]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/cpufreq/cpufreq.c
[CPUFREQ] Eliminate the recent lockdep warnings in cpufreq
[mirror_ubuntu-artful-kernel.git] / drivers / cpufreq / cpufreq.c
index 6e2ec0b189489803ebaa55ecb4ae094bd2a1fdf0..c7fe16e0474b738f9f60260caf0480d1054365a3 100644 (file)
@@ -1070,8 +1070,6 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
        spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
 #endif
 
-       unlock_policy_rwsem_write(cpu);
-
        if (cpufreq_driver->target)
                __cpufreq_governor(data, CPUFREQ_GOV_STOP);
 
@@ -1088,6 +1086,8 @@ static int __cpufreq_remove_dev(struct sys_device *sys_dev)
        if (cpufreq_driver->exit)
                cpufreq_driver->exit(data);
 
+       unlock_policy_rwsem_write(cpu);
+
        free_cpumask_var(data->related_cpus);
        free_cpumask_var(data->cpus);
        kfree(data);