Skip to content

Commit f6aeccd

Browse files
Jan BeulichGuenter Roeck
authored andcommitted
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>
1 parent a465905 commit f6aeccd

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

drivers/hwmon/pkgtemp.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -284,9 +284,10 @@ static int __cpuinit pkgtemp_device_add(unsigned int cpu)
284284
int err;
285285
struct platform_device *pdev;
286286
struct pdev_entry *pdev_entry;
287-
#ifdef CONFIG_SMP
288287
struct cpuinfo_x86 *c = &cpu_data(cpu);
289-
#endif
288+
289+
if (!cpu_has(c, X86_FEATURE_PTS))
290+
return 0;
290291

291292
mutex_lock(&pdev_list_mutex);
292293

@@ -403,11 +404,6 @@ static int __init pkgtemp_init(void)
403404
goto exit;
404405

405406
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-
411407
err = pkgtemp_device_add(i);
412408
if (err)
413409
goto exit_devices_unreg;

0 commit comments

Comments
 (0)