Commit d434fca7 authored by Ashok Raj's avatar Ashok Raj Committed by Linus Torvalds

[PATCH] Remove cpu_sys_devices in cpufreq subsystem.

cpu_sys_devices is redundant with the new API get_cpu_sysdev().  So nuking
this usage since its not needed.
Signed-off-by: default avatarAshok Raj <ashok.raj@intel.com>
Signed-off-by: default avatarVenkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Dave Jones <davej@codemonkey.org.uk>
Cc: Zwane Mwaikambo <zwane@holomorphy.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1aa1a9f9
...@@ -36,13 +36,6 @@ static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS]; ...@@ -36,13 +36,6 @@ static struct cpufreq_policy *cpufreq_cpu_data[NR_CPUS];
static DEFINE_SPINLOCK(cpufreq_driver_lock); static DEFINE_SPINLOCK(cpufreq_driver_lock);
/* we keep a copy of all ->add'ed CPU's struct sys_device here;
* as it is only accessed in ->add and ->remove, no lock or reference
* count is necessary.
*/
static struct sys_device *cpu_sys_devices[NR_CPUS];
/* internal prototypes */ /* internal prototypes */
static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event); static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event);
static void handle_update(void *data); static void handle_update(void *data);
...@@ -582,7 +575,6 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) ...@@ -582,7 +575,6 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
* CPU because it is in the same boat. */ * CPU because it is in the same boat. */
policy = cpufreq_cpu_get(cpu); policy = cpufreq_cpu_get(cpu);
if (unlikely(policy)) { if (unlikely(policy)) {
cpu_sys_devices[cpu] = sys_dev;
dprintk("CPU already managed, adding link\n"); dprintk("CPU already managed, adding link\n");
sysfs_create_link(&sys_dev->kobj, &policy->kobj, "cpufreq"); sysfs_create_link(&sys_dev->kobj, &policy->kobj, "cpufreq");
cpufreq_debug_enable_ratelimit(); cpufreq_debug_enable_ratelimit();
...@@ -657,7 +649,6 @@ static int cpufreq_add_dev (struct sys_device * sys_dev) ...@@ -657,7 +649,6 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
} }
module_put(cpufreq_driver->owner); module_put(cpufreq_driver->owner);
cpu_sys_devices[cpu] = sys_dev;
dprintk("initialization complete\n"); dprintk("initialization complete\n");
cpufreq_debug_enable_ratelimit(); cpufreq_debug_enable_ratelimit();
...@@ -698,6 +689,7 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev) ...@@ -698,6 +689,7 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
unsigned int cpu = sys_dev->id; unsigned int cpu = sys_dev->id;
unsigned long flags; unsigned long flags;
struct cpufreq_policy *data; struct cpufreq_policy *data;
struct sys_device *cpu_sys_dev;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
unsigned int j; unsigned int j;
#endif #endif
...@@ -710,7 +702,6 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev) ...@@ -710,7 +702,6 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
if (!data) { if (!data) {
spin_unlock_irqrestore(&cpufreq_driver_lock, flags); spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
cpu_sys_devices[cpu] = NULL;
cpufreq_debug_enable_ratelimit(); cpufreq_debug_enable_ratelimit();
return -EINVAL; return -EINVAL;
} }
...@@ -725,14 +716,12 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev) ...@@ -725,14 +716,12 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
dprintk("removing link\n"); dprintk("removing link\n");
spin_unlock_irqrestore(&cpufreq_driver_lock, flags); spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
sysfs_remove_link(&sys_dev->kobj, "cpufreq"); sysfs_remove_link(&sys_dev->kobj, "cpufreq");
cpu_sys_devices[cpu] = NULL;
cpufreq_cpu_put(data); cpufreq_cpu_put(data);
cpufreq_debug_enable_ratelimit(); cpufreq_debug_enable_ratelimit();
return 0; return 0;
} }
#endif #endif
cpu_sys_devices[cpu] = NULL;
if (!kobject_get(&data->kobj)) { if (!kobject_get(&data->kobj)) {
spin_unlock_irqrestore(&cpufreq_driver_lock, flags); spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
...@@ -761,7 +750,8 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev) ...@@ -761,7 +750,8 @@ static int cpufreq_remove_dev (struct sys_device * sys_dev)
if (j == cpu) if (j == cpu)
continue; continue;
dprintk("removing link for cpu %u\n", j); dprintk("removing link for cpu %u\n", j);
sysfs_remove_link(&cpu_sys_devices[j]->kobj, "cpufreq"); cpu_sys_dev = get_cpu_sysdev(j);
sysfs_remove_link(&cpu_sys_dev->kobj, "cpufreq");
cpufreq_cpu_put(data); cpufreq_cpu_put(data);
} }
} }
......
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