[PATCH] x86/hwmon: fix initialization of pkgtemp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Feature availability should also be checked in the hotplug code path.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Cc: Fenghua Yu <fenghua.yu@xxxxxxxxx>

---
 drivers/hwmon/pkgtemp.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

--- linux-2.6.36-rc4/drivers/hwmon/pkgtemp.c	2010-09-13 08:45:03.000000000 +0200
+++ 2.6.36-rc4-x86-pkgtemp-feature-check/drivers/hwmon/pkgtemp.c	2010-09-03 17:54:30.000000000 +0200
@@ -281,9 +281,10 @@ static int __cpuinit pkgtemp_device_add(
 	int err;
 	struct platform_device *pdev;
 	struct pdev_entry *pdev_entry;
-#ifdef CONFIG_SMP
 	struct cpuinfo_x86 *c = &cpu_data(cpu);
-#endif
+
+	if (!cpu_has(c, X86_FEATURE_PTS))
+		return 0;
 
 	mutex_lock(&pdev_list_mutex);
 
@@ -399,11 +400,6 @@ static int __init pkgtemp_init(void)
 		goto exit;
 
 	for_each_online_cpu(i) {
-		struct cpuinfo_x86 *c = &cpu_data(i);
-
-		if (!cpu_has(c, X86_FEATURE_PTS))
-			continue;
-
 		err = pkgtemp_device_add(i);
 		if (err)
 			goto exit_devices_unreg;




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


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux