* update and cleanup patches for core{pkg, via}temp etc.
@ 2010-10-08 5:53 Chen Gong
2010-10-08 5:53 ` [PATCH V2 1/2] hwmon: uniform the init style of pkgtemp Chen Gong
2010-10-08 5:53 ` [PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition Chen Gong
0 siblings, 2 replies; 8+ messages in thread
From: Chen Gong @ 2010-10-08 5:53 UTC (permalink / raw)
To: lm-sensors; +Cc: JBeulich, guenter.roeck, linux-kernel
[PATCH V2 1/2] hwmon: uniform the init style of pkgtemp
[PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition
These 2 patches don't supply new functions, just unify the codes to avoid
potential issues and some cleanup work.
V2: fix some compile errors.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH V2 1/2] hwmon: uniform the init style of pkgtemp
2010-10-08 5:53 update and cleanup patches for core{pkg, via}temp etc Chen Gong
@ 2010-10-08 5:53 ` Chen Gong
2010-10-08 12:08 ` Guenter Roeck
2010-10-08 5:53 ` [PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition Chen Gong
1 sibling, 1 reply; 8+ messages in thread
From: Chen Gong @ 2010-10-08 5:53 UTC (permalink / raw)
To: lm-sensors; +Cc: JBeulich, guenter.roeck, linux-kernel, Chen Gong
pkgtemp is derived from coretemp, so some reasonable
logics should be applied onto pkgtemp, too. Such as
the init logic here.
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
---
drivers/hwmon/pkgtemp.c | 22 ++++++++--------------
1 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/drivers/hwmon/pkgtemp.c b/drivers/hwmon/pkgtemp.c
index f119039..29fef42 100644
--- a/drivers/hwmon/pkgtemp.c
+++ b/drivers/hwmon/pkgtemp.c
@@ -35,6 +35,7 @@
#include <linux/cpu.h>
#include <asm/msr.h>
#include <asm/processor.h>
+#include <asm/smp.h>
#define DRVNAME "pkgtemp"
@@ -392,7 +393,6 @@ static struct notifier_block pkgtemp_cpu_notifier __refdata = {
static int __init pkgtemp_init(void)
{
int i, err = -ENODEV;
- struct pdev_entry *p, *n;
/* quick check if we run Intel */
if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL)
@@ -402,31 +402,25 @@ static int __init pkgtemp_init(void)
if (err)
goto exit;
- for_each_online_cpu(i) {
- err = pkgtemp_device_add(i);
- if (err)
- goto exit_devices_unreg;
- }
+ for_each_online_cpu(i)
+ pkgtemp_device_add(i);
+
+#ifndef CONFIG_HOTPLUG_CPU
if (list_empty(&pdev_list)) {
err = -ENODEV;
goto exit_driver_unreg;
}
+#endif
#ifdef CONFIG_HOTPLUG_CPU
register_hotcpu_notifier(&pkgtemp_cpu_notifier);
#endif
return 0;
-exit_devices_unreg:
- mutex_lock(&pdev_list_mutex);
- list_for_each_entry_safe(p, n, &pdev_list, list) {
- platform_device_unregister(p->pdev);
- list_del(&p->list);
- kfree(p);
- }
- mutex_unlock(&pdev_list_mutex);
+#ifndef CONFIG_HOTPLUG_CPU
exit_driver_unreg:
platform_driver_unregister(&pkgtemp_driver);
+#endif
exit:
return err;
}
--
1.7.2.2.173.g515cc
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition
2010-10-08 5:53 update and cleanup patches for core{pkg, via}temp etc Chen Gong
2010-10-08 5:53 ` [PATCH V2 1/2] hwmon: uniform the init style of pkgtemp Chen Gong
@ 2010-10-08 5:53 ` Chen Gong
2010-10-08 12:11 ` Guenter Roeck
` (2 more replies)
1 sibling, 3 replies; 8+ messages in thread
From: Chen Gong @ 2010-10-08 5:53 UTC (permalink / raw)
To: lm-sensors; +Cc: JBeulich, guenter.roeck, linux-kernel, Chen Gong
CONFIG_HOTPLUG_CPU is used too much in some drivers.
This patch clean them up and add some proper __cpuinit definitons.
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
---
drivers/hwmon/coretemp.c | 5 ++---
drivers/hwmon/pkgtemp.c | 9 ++-------
drivers/hwmon/via-cputemp.c | 9 ++-------
3 files changed, 6 insertions(+), 17 deletions(-)
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index a23b17a..2ec3cc3 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -490,7 +490,7 @@ exit:
return err;
}
-static void coretemp_device_remove(unsigned int cpu)
+static void __cpuinit coretemp_device_remove(unsigned int cpu)
{
struct pdev_entry *p;
unsigned int i;
@@ -569,9 +569,8 @@ exit:
static void __exit coretemp_exit(void)
{
struct pdev_entry *p, *n;
-#ifdef CONFIG_HOTPLUG_CPU
+
unregister_hotcpu_notifier(&coretemp_cpu_notifier);
-#endif
mutex_lock(&pdev_list_mutex);
list_for_each_entry_safe(p, n, &pdev_list, list) {
platform_device_unregister(p->pdev);
diff --git a/drivers/hwmon/pkgtemp.c b/drivers/hwmon/pkgtemp.c
index 29fef42..ee22313 100644
--- a/drivers/hwmon/pkgtemp.c
+++ b/drivers/hwmon/pkgtemp.c
@@ -340,8 +340,7 @@ exit:
return err;
}
-#ifdef CONFIG_HOTPLUG_CPU
-static void pkgtemp_device_remove(unsigned int cpu)
+static void __cpuinit pkgtemp_device_remove(unsigned int cpu)
{
struct pdev_entry *p;
unsigned int i;
@@ -388,7 +387,6 @@ static int __cpuinit pkgtemp_cpu_callback(struct notifier_block *nfb,
static struct notifier_block pkgtemp_cpu_notifier __refdata = {
.notifier_call = pkgtemp_cpu_callback,
};
-#endif /* !CONFIG_HOTPLUG_CPU */
static int __init pkgtemp_init(void)
{
@@ -412,9 +410,7 @@ static int __init pkgtemp_init(void)
}
#endif
-#ifdef CONFIG_HOTPLUG_CPU
register_hotcpu_notifier(&pkgtemp_cpu_notifier);
-#endif
return 0;
#ifndef CONFIG_HOTPLUG_CPU
@@ -428,9 +424,8 @@ exit:
static void __exit pkgtemp_exit(void)
{
struct pdev_entry *p, *n;
-#ifdef CONFIG_HOTPLUG_CPU
+
unregister_hotcpu_notifier(&pkgtemp_cpu_notifier);
-#endif
mutex_lock(&pdev_list_mutex);
list_for_each_entry_safe(p, n, &pdev_list, list) {
platform_device_unregister(p->pdev);
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
index ffb793a..ebbdc25 100644
--- a/drivers/hwmon/via-cputemp.c
+++ b/drivers/hwmon/via-cputemp.c
@@ -237,8 +237,7 @@ exit:
return err;
}
-#ifdef CONFIG_HOTPLUG_CPU
-static void via_cputemp_device_remove(unsigned int cpu)
+static void __cpuinit via_cputemp_device_remove(unsigned int cpu)
{
struct pdev_entry *p, *n;
mutex_lock(&pdev_list_mutex);
@@ -272,7 +271,6 @@ static int __cpuinit via_cputemp_cpu_callback(struct notifier_block *nfb,
static struct notifier_block via_cputemp_cpu_notifier __refdata = {
.notifier_call = via_cputemp_cpu_callback,
};
-#endif /* !CONFIG_HOTPLUG_CPU */
static int __init via_cputemp_init(void)
{
@@ -313,9 +311,7 @@ static int __init via_cputemp_init(void)
goto exit_driver_unreg;
}
-#ifdef CONFIG_HOTPLUG_CPU
register_hotcpu_notifier(&via_cputemp_cpu_notifier);
-#endif
return 0;
exit_devices_unreg:
@@ -335,9 +331,8 @@ exit:
static void __exit via_cputemp_exit(void)
{
struct pdev_entry *p, *n;
-#ifdef CONFIG_HOTPLUG_CPU
+
unregister_hotcpu_notifier(&via_cputemp_cpu_notifier);
-#endif
mutex_lock(&pdev_list_mutex);
list_for_each_entry_safe(p, n, &pdev_list, list) {
platform_device_unregister(p->pdev);
--
1.7.2.2.173.g515cc
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH V2 1/2] hwmon: uniform the init style of pkgtemp
2010-10-08 5:53 ` [PATCH V2 1/2] hwmon: uniform the init style of pkgtemp Chen Gong
@ 2010-10-08 12:08 ` Guenter Roeck
0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2010-10-08 12:08 UTC (permalink / raw)
To: Chen Gong
Cc: lm-sensors@lm-sensors.org, JBeulich@novell.com,
linux-kernel@vger.kernel.org
On Fri, Oct 08, 2010 at 01:53:35AM -0400, Chen Gong wrote:
> pkgtemp is derived from coretemp, so some reasonable
> logics should be applied onto pkgtemp, too. Such as
> the init logic here.
>
> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Applied.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition
2010-10-08 5:53 ` [PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition Chen Gong
@ 2010-10-08 12:11 ` Guenter Roeck
2010-10-09 2:01 ` the 2nd patch is updated Chen Gong
2010-10-09 2:01 ` [PATCH] hwmon: cleanup useless hotplug related macro definition Chen Gong
2 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2010-10-08 12:11 UTC (permalink / raw)
To: Chen Gong
Cc: lm-sensors@lm-sensors.org, JBeulich@novell.com,
linux-kernel@vger.kernel.org
On Fri, Oct 08, 2010 at 01:53:36AM -0400, Chen Gong wrote:
> CONFIG_HOTPLUG_CPU is used too much in some drivers.
> This patch clean them up and add some proper __cpuinit definitons.
>
> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Please rebase this patch to
git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging.git hwmon-next
Some of the changes are already applied through other patches.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 8+ messages in thread
* the 2nd patch is updated
2010-10-08 5:53 ` [PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition Chen Gong
2010-10-08 12:11 ` Guenter Roeck
@ 2010-10-09 2:01 ` Chen Gong
2010-10-09 2:01 ` [PATCH] hwmon: cleanup useless hotplug related macro definition Chen Gong
2 siblings, 0 replies; 8+ messages in thread
From: Chen Gong @ 2010-10-09 2:01 UTC (permalink / raw)
To: guenter.roeck; +Cc: lm-sensors, JBeulich, linux-kernel
This patch is updated based on hwmon-next tree now.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] hwmon: cleanup useless hotplug related macro definition
2010-10-08 5:53 ` [PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition Chen Gong
2010-10-08 12:11 ` Guenter Roeck
2010-10-09 2:01 ` the 2nd patch is updated Chen Gong
@ 2010-10-09 2:01 ` Chen Gong
2010-10-09 16:43 ` Guenter Roeck
2 siblings, 1 reply; 8+ messages in thread
From: Chen Gong @ 2010-10-09 2:01 UTC (permalink / raw)
To: guenter.roeck; +Cc: lm-sensors, JBeulich, linux-kernel, Chen Gong
CONFIG_HOTPLUG_CPU is used too much in some drivers.
This patch clean them up.
Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
---
drivers/hwmon/coretemp.c | 3 +--
drivers/hwmon/pkgtemp.c | 7 +------
drivers/hwmon/via-cputemp.c | 7 +------
3 files changed, 3 insertions(+), 14 deletions(-)
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index b4aea20..467488c 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -566,9 +566,8 @@ exit:
static void __exit coretemp_exit(void)
{
struct pdev_entry *p, *n;
-#ifdef CONFIG_HOTPLUG_CPU
+
unregister_hotcpu_notifier(&coretemp_cpu_notifier);
-#endif
mutex_lock(&pdev_list_mutex);
list_for_each_entry_safe(p, n, &pdev_list, list) {
platform_device_unregister(p->pdev);
diff --git a/drivers/hwmon/pkgtemp.c b/drivers/hwmon/pkgtemp.c
index a8fc35e..0798210 100644
--- a/drivers/hwmon/pkgtemp.c
+++ b/drivers/hwmon/pkgtemp.c
@@ -339,7 +339,6 @@ exit:
return err;
}
-#ifdef CONFIG_HOTPLUG_CPU
static void __cpuinit pkgtemp_device_remove(unsigned int cpu)
{
struct pdev_entry *p;
@@ -387,7 +386,6 @@ static int __cpuinit pkgtemp_cpu_callback(struct notifier_block *nfb,
static struct notifier_block pkgtemp_cpu_notifier __refdata = {
.notifier_call = pkgtemp_cpu_callback,
};
-#endif /* !CONFIG_HOTPLUG_CPU */
static int __init pkgtemp_init(void)
{
@@ -411,9 +409,7 @@ static int __init pkgtemp_init(void)
}
#endif
-#ifdef CONFIG_HOTPLUG_CPU
register_hotcpu_notifier(&pkgtemp_cpu_notifier);
-#endif
return 0;
#ifndef CONFIG_HOTPLUG_CPU
@@ -427,9 +423,8 @@ exit:
static void __exit pkgtemp_exit(void)
{
struct pdev_entry *p, *n;
-#ifdef CONFIG_HOTPLUG_CPU
+
unregister_hotcpu_notifier(&pkgtemp_cpu_notifier);
-#endif
mutex_lock(&pdev_list_mutex);
list_for_each_entry_safe(p, n, &pdev_list, list) {
platform_device_unregister(p->pdev);
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c
index ba7839b..ec7fad7 100644
--- a/drivers/hwmon/via-cputemp.c
+++ b/drivers/hwmon/via-cputemp.c
@@ -235,7 +235,6 @@ exit:
return err;
}
-#ifdef CONFIG_HOTPLUG_CPU
static void __cpuinit via_cputemp_device_remove(unsigned int cpu)
{
struct pdev_entry *p, *n;
@@ -270,7 +269,6 @@ static int __cpuinit via_cputemp_cpu_callback(struct notifier_block *nfb,
static struct notifier_block via_cputemp_cpu_notifier __refdata = {
.notifier_call = via_cputemp_cpu_callback,
};
-#endif /* !CONFIG_HOTPLUG_CPU */
static int __init via_cputemp_init(void)
{
@@ -311,9 +309,7 @@ static int __init via_cputemp_init(void)
goto exit_driver_unreg;
}
-#ifdef CONFIG_HOTPLUG_CPU
register_hotcpu_notifier(&via_cputemp_cpu_notifier);
-#endif
return 0;
exit_devices_unreg:
@@ -333,9 +329,8 @@ exit:
static void __exit via_cputemp_exit(void)
{
struct pdev_entry *p, *n;
-#ifdef CONFIG_HOTPLUG_CPU
+
unregister_hotcpu_notifier(&via_cputemp_cpu_notifier);
-#endif
mutex_lock(&pdev_list_mutex);
list_for_each_entry_safe(p, n, &pdev_list, list) {
platform_device_unregister(p->pdev);
--
1.7.2.2.173.g515cc
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] hwmon: cleanup useless hotplug related macro definition
2010-10-09 2:01 ` [PATCH] hwmon: cleanup useless hotplug related macro definition Chen Gong
@ 2010-10-09 16:43 ` Guenter Roeck
0 siblings, 0 replies; 8+ messages in thread
From: Guenter Roeck @ 2010-10-09 16:43 UTC (permalink / raw)
To: Chen Gong
Cc: lm-sensors@lm-sensors.org, JBeulich@novell.com,
linux-kernel@vger.kernel.org
On Fri, Oct 08, 2010 at 10:01:48PM -0400, Chen Gong wrote:
> CONFIG_HOTPLUG_CPU is used too much in some drivers.
> This patch clean them up.
>
> Signed-off-by: Chen Gong <gong.chen@linux.intel.com>
Applied.
Thanks,
Guenter
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-10-09 16:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-08 5:53 update and cleanup patches for core{pkg, via}temp etc Chen Gong
2010-10-08 5:53 ` [PATCH V2 1/2] hwmon: uniform the init style of pkgtemp Chen Gong
2010-10-08 12:08 ` Guenter Roeck
2010-10-08 5:53 ` [PATCH V2 2/2] hwmon: cleanup some hotplug related macro definition Chen Gong
2010-10-08 12:11 ` Guenter Roeck
2010-10-09 2:01 ` the 2nd patch is updated Chen Gong
2010-10-09 2:01 ` [PATCH] hwmon: cleanup useless hotplug related macro definition Chen Gong
2010-10-09 16:43 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox