All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] [PATCH] sync via-cputemp with coretemp/pkgtemp
@ 2010-12-06 16:48 Jan Beulich
  2010-12-06 22:48 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2010-12-06 16:48 UTC (permalink / raw)
  To: lm-sensors

... in terms of hotplug handling.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

---
 drivers/hwmon/via-cputemp.c |   25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

--- linux-2.6.37-rc4/drivers/hwmon/via-cputemp.c
+++ 2.6.37-rc4-x86-hwmon/drivers/hwmon/via-cputemp.c
@@ -237,13 +237,16 @@ exit:
 
 static void __cpuinit via_cputemp_device_remove(unsigned int cpu)
 {
-	struct pdev_entry *p, *n;
+	struct pdev_entry *p;
+
 	mutex_lock(&pdev_list_mutex);
-	list_for_each_entry_safe(p, n, &pdev_list, list) {
+	list_for_each_entry(p, &pdev_list, list) {
 		if (p->cpu = cpu) {
 			platform_device_unregister(p->pdev);
 			list_del(&p->list);
+			mutex_unlock(&pdev_list_mutex);
 			kfree(p);
+			return;
 		}
 	}
 	mutex_unlock(&pdev_list_mutex);
@@ -273,7 +276,6 @@ static struct notifier_block via_cputemp
 static int __init via_cputemp_init(void)
 {
 	int i, err;
-	struct pdev_entry *p, *n;
 
 	if (cpu_data(0).x86_vendor != X86_VENDOR_CENTAUR) {
 		printk(KERN_DEBUG DRVNAME ": Not a VIA CPU\n");
@@ -300,28 +302,23 @@ static int __init via_cputemp_init(void)
 			continue;
 		}
 
-		err = via_cputemp_device_add(i);
-		if (err)
-			goto exit_devices_unreg;
+		via_cputemp_device_add(i);
 	}
+
+#ifndef CONFIG_HOTPLUG_CPU
 	if (list_empty(&pdev_list)) {
 		err = -ENODEV;
 		goto exit_driver_unreg;
 	}
+#endif
 
 	register_hotcpu_notifier(&via_cputemp_cpu_notifier);
 	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(&via_cputemp_driver);
+#endif
 exit:
 	return err;
 }




_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [lm-sensors] [PATCH] sync via-cputemp with coretemp/pkgtemp
  2010-12-06 16:48 [lm-sensors] [PATCH] sync via-cputemp with coretemp/pkgtemp Jan Beulich
@ 2010-12-06 22:48 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2010-12-06 22:48 UTC (permalink / raw)
  To: lm-sensors

On Mon, Dec 06, 2010 at 11:48:35AM -0500, Jan Beulich wrote:
> ... in terms of hotplug handling.
> 
> Signed-off-by: Jan Beulich <jbeulich@novell.com>
> 
Queued for -next.

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-06 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-06 16:48 [lm-sensors] [PATCH] sync via-cputemp with coretemp/pkgtemp Jan Beulich
2010-12-06 22:48 ` Guenter Roeck

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.