aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2010-09-13 06:18:54 -0400
committerGuenter Roeck <guenter.roeck@ericsson.com>2010-09-24 14:44:19 -0400
commitf6aeccdb96fc0555e939dd507702922f07dcbcbb (patch)
treed3b552f34d98902931a9a3a5432663361b3dc788 /drivers/hwmon
parenta46590533ad7b0f3f640732081d7e1658145c0ba (diff)
x86/hwmon: fix initialization of pkgtemp
Feature availability should also be checked in the hotplug code path. Signed-off-by: Jan Beulich <jbeulich@novell.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/pkgtemp.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/hwmon/pkgtemp.c b/drivers/hwmon/pkgtemp.c
index f7ddee5fe9d5..ab89f23eebdf 100644
--- a/drivers/hwmon/pkgtemp.c
+++ b/drivers/hwmon/pkgtemp.c
@@ -284,9 +284,10 @@ static int __cpuinit pkgtemp_device_add(unsigned int cpu)
284 int err; 284 int err;
285 struct platform_device *pdev; 285 struct platform_device *pdev;
286 struct pdev_entry *pdev_entry; 286 struct pdev_entry *pdev_entry;
287#ifdef CONFIG_SMP
288 struct cpuinfo_x86 *c = &cpu_data(cpu); 287 struct cpuinfo_x86 *c = &cpu_data(cpu);
289#endif 288
289 if (!cpu_has(c, X86_FEATURE_PTS))
290 return 0;
290 291
291 mutex_lock(&pdev_list_mutex); 292 mutex_lock(&pdev_list_mutex);
292 293
@@ -403,11 +404,6 @@ static int __init pkgtemp_init(void)
403 goto exit; 404 goto exit;
404 405
405 for_each_online_cpu(i) { 406 for_each_online_cpu(i) {
406 struct cpuinfo_x86 *c = &cpu_data(i);
407
408 if (!cpu_has(c, X86_FEATURE_PTS))
409 continue;
410
411 err = pkgtemp_device_add(i); 407 err = pkgtemp_device_add(i);
412 if (err) 408 if (err)
413 goto exit_devices_unreg; 409 goto exit_devices_unreg;