From: Ashok Raj <ashok.raj@intel.com>
To: akpm@osdl.org, linux@brodo.de
Cc: davej@redhat.com, zwane@arm.linux.org.uk,
linux-kernel@vger.kernel.org, Ashok Raj <ashok.raj@intel.com>,
Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Subject: [patch 3/4] Remove cpu_sys_devices in cpufreq subsystem.
Date: Fri, 21 Oct 2005 13:38:21 -0700 [thread overview]
Message-ID: <20051021204327.725306000@araj-sfield> (raw)
In-Reply-To: <20051021203818.753754000@araj-sfield>
[-- Attachment #1: remove-cpufreq-cpu-sysdev --]
[-- Type: text/plain, Size: 2933 bytes --]
cpu_sys_devices is redundant with the new API get_cpu_sysdev().
So nuking this usage since its not needed.
Depends on: get_cpu_sysdev() patch.
Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
------------------------------------------------------------
drivers/cpufreq/cpufreq.c | 16 +++-------------
1 files changed, 3 insertions(+), 13 deletions(-)
Index: linux-2.6.14-rc4-mm1/drivers/cpufreq/cpufreq.c
===================================================================
--- linux-2.6.14-rc4-mm1.orig/drivers/cpufreq/cpufreq.c
+++ linux-2.6.14-rc4-mm1/drivers/cpufreq/cpufreq.c
@@ -36,13 +36,6 @@ static struct cpufreq_policy *cpufreq_cp
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 */
static int __cpufreq_governor(struct cpufreq_policy *policy, unsigned int event);
static void handle_update(void *data);
@@ -582,7 +575,6 @@ static int cpufreq_add_dev (struct sys_d
* CPU because it is in the same boat. */
policy = cpufreq_cpu_get(cpu);
if (unlikely(policy)) {
- cpu_sys_devices[cpu] = sys_dev;
dprintk("CPU already managed, adding link\n");
sysfs_create_link(&sys_dev->kobj, &policy->kobj, "cpufreq");
cpufreq_debug_enable_ratelimit();
@@ -656,7 +648,6 @@ static int cpufreq_add_dev (struct sys_d
}
module_put(cpufreq_driver->owner);
- cpu_sys_devices[cpu] = sys_dev;
dprintk("initialization complete\n");
cpufreq_debug_enable_ratelimit();
@@ -697,6 +688,7 @@ static int cpufreq_remove_dev (struct sy
unsigned int cpu = sys_dev->id;
unsigned long flags;
struct cpufreq_policy *data;
+ struct sys_device *cpu_sys_dev;
#ifdef CONFIG_SMP
unsigned int j;
#endif
@@ -709,7 +701,6 @@ static int cpufreq_remove_dev (struct sy
if (!data) {
spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
- cpu_sys_devices[cpu] = NULL;
cpufreq_debug_enable_ratelimit();
return -EINVAL;
}
@@ -724,14 +715,12 @@ static int cpufreq_remove_dev (struct sy
dprintk("removing link\n");
spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
sysfs_remove_link(&sys_dev->kobj, "cpufreq");
- cpu_sys_devices[cpu] = NULL;
cpufreq_cpu_put(data);
cpufreq_debug_enable_ratelimit();
return 0;
}
#endif
- cpu_sys_devices[cpu] = NULL;
if (!kobject_get(&data->kobj)) {
spin_unlock_irqrestore(&cpufreq_driver_lock, flags);
@@ -760,7 +749,8 @@ static int cpufreq_remove_dev (struct sy
if (j == cpu)
continue;
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);
}
}
--
next prev parent reply other threads:[~2005-10-24 18:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-21 20:38 [patch 0/4] dynamically create "cache" and "cpufreq" entries with CPU hotplug Ashok Raj
2005-10-21 20:38 ` [patch 1/4] introduce get_cpu_sysdev() to retrieve a sysfs entry for a cpu Ashok Raj
2005-10-21 20:38 ` [patch 2/4] create and destroy cache sysfs entries based on cpu notifiers Ashok Raj
2005-10-21 20:38 ` Ashok Raj [this message]
2005-10-21 20:38 ` [patch 4/4] create and destroy cpufreq " Ashok Raj
2005-11-07 11:41 ` Nathan Lynch
2005-11-07 14:27 ` Ashok Raj
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051021204327.725306000@araj-sfield \
--to=ashok.raj@intel.com \
--cc=akpm@osdl.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@brodo.de \
--cc=venkatesh.pallipadi@intel.com \
--cc=zwane@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®