diff options
author | Jan Beulich <jbeulich@novell.com> | 2010-09-13 14:18:54 +0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2010-09-24 22:44:19 +0400 |
commit | f6aeccdb96fc0555e939dd507702922f07dcbcbb (patch) | |
tree | d3b552f34d98902931a9a3a5432663361b3dc788 /drivers | |
parent | a46590533ad7b0f3f640732081d7e1658145c0ba (diff) | |
download | linux-f6aeccdb96fc0555e939dd507702922f07dcbcbb.tar.xz |
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')
-rw-r--r-- | drivers/hwmon/pkgtemp.c | 10 |
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) 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); @@ -403,11 +404,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; |