aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2013-07-31 08:35:14 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-07 17:02:49 -0400
commit308b60e71541518f3fe97171b4daf71adc607f3d (patch)
tree68fe14f51491ed4e07019e6934352d3c00c57ea7 /drivers/cpufreq/cpufreq.c
parente8fdde1011ea45792e60f14f620b01f78cb0d34d (diff)
cpufreq: Don't pass CPU to cpufreq_add_dev_{symlink|interface}()
Pointer to struct cpufreq_policy is already passed to these routines and we don't need to send policy->cpu to them as well. So, get rid of this extra argument and use policy->cpu everywhere. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index b6154ca1f896..576b312645a5 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -806,8 +806,7 @@ void cpufreq_sysfs_remove_file(const struct attribute *attr)
806EXPORT_SYMBOL(cpufreq_sysfs_remove_file); 806EXPORT_SYMBOL(cpufreq_sysfs_remove_file);
807 807
808/* symlink affected CPUs */ 808/* symlink affected CPUs */
809static int cpufreq_add_dev_symlink(unsigned int cpu, 809static int cpufreq_add_dev_symlink(struct cpufreq_policy *policy)
810 struct cpufreq_policy *policy)
811{ 810{
812 unsigned int j; 811 unsigned int j;
813 int ret = 0; 812 int ret = 0;
@@ -815,11 +814,11 @@ static int cpufreq_add_dev_symlink(unsigned int cpu,
815 for_each_cpu(j, policy->cpus) { 814 for_each_cpu(j, policy->cpus) {
816 struct device *cpu_dev; 815 struct device *cpu_dev;
817 816
818 if (j == cpu) 817 if (j == policy->cpu)
819 continue; 818 continue;
820 819
821 pr_debug("Adding link for CPU: %u\n", j); 820 pr_debug("Adding link for CPU: %u\n", j);
822 cpufreq_cpu_get(cpu); 821 cpufreq_cpu_get(policy->cpu);
823 cpu_dev = get_cpu_device(j); 822 cpu_dev = get_cpu_device(j);
824 ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj, 823 ret = sysfs_create_link(&cpu_dev->kobj, &policy->kobj,
825 "cpufreq"); 824 "cpufreq");
@@ -831,8 +830,7 @@ static int cpufreq_add_dev_symlink(unsigned int cpu,
831 return ret; 830 return ret;
832} 831}
833 832
834static int cpufreq_add_dev_interface(unsigned int cpu, 833static int cpufreq_add_dev_interface(struct cpufreq_policy *policy,
835 struct cpufreq_policy *policy,
836 struct device *dev) 834 struct device *dev)
837{ 835{
838 struct freq_attr **drv_attr; 836 struct freq_attr **drv_attr;
@@ -868,7 +866,7 @@ static int cpufreq_add_dev_interface(unsigned int cpu,
868 goto err_out_kobj_put; 866 goto err_out_kobj_put;
869 } 867 }
870 868
871 ret = cpufreq_add_dev_symlink(cpu, policy); 869 ret = cpufreq_add_dev_symlink(policy);
872 if (ret) 870 if (ret)
873 goto err_out_kobj_put; 871 goto err_out_kobj_put;
874 872
@@ -1097,7 +1095,7 @@ static int __cpufreq_add_dev(struct device *dev, struct subsys_interface *sif,
1097 write_unlock_irqrestore(&cpufreq_driver_lock, flags); 1095 write_unlock_irqrestore(&cpufreq_driver_lock, flags);
1098 1096
1099 if (!frozen) { 1097 if (!frozen) {
1100 ret = cpufreq_add_dev_interface(cpu, policy, dev); 1098 ret = cpufreq_add_dev_interface(policy, dev);
1101 if (ret) 1099 if (ret)
1102 goto err_out_unregister; 1100 goto err_out_unregister;
1103 } 1101 }