diff options
Diffstat (limited to 'drivers/hwmon/via-cputemp.c')
-rw-r--r-- | drivers/hwmon/via-cputemp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hwmon/via-cputemp.c b/drivers/hwmon/via-cputemp.c index ee4ebc198a94..2e56c6ce9fb6 100644 --- a/drivers/hwmon/via-cputemp.c +++ b/drivers/hwmon/via-cputemp.c | |||
@@ -328,6 +328,7 @@ static int __init via_cputemp_init(void) | |||
328 | if (err) | 328 | if (err) |
329 | goto exit; | 329 | goto exit; |
330 | 330 | ||
331 | get_online_cpus(); | ||
331 | for_each_online_cpu(i) { | 332 | for_each_online_cpu(i) { |
332 | struct cpuinfo_x86 *c = &cpu_data(i); | 333 | struct cpuinfo_x86 *c = &cpu_data(i); |
333 | 334 | ||
@@ -347,12 +348,14 @@ static int __init via_cputemp_init(void) | |||
347 | 348 | ||
348 | #ifndef CONFIG_HOTPLUG_CPU | 349 | #ifndef CONFIG_HOTPLUG_CPU |
349 | if (list_empty(&pdev_list)) { | 350 | if (list_empty(&pdev_list)) { |
351 | put_online_cpus(); | ||
350 | err = -ENODEV; | 352 | err = -ENODEV; |
351 | goto exit_driver_unreg; | 353 | goto exit_driver_unreg; |
352 | } | 354 | } |
353 | #endif | 355 | #endif |
354 | 356 | ||
355 | register_hotcpu_notifier(&via_cputemp_cpu_notifier); | 357 | register_hotcpu_notifier(&via_cputemp_cpu_notifier); |
358 | put_online_cpus(); | ||
356 | return 0; | 359 | return 0; |
357 | 360 | ||
358 | #ifndef CONFIG_HOTPLUG_CPU | 361 | #ifndef CONFIG_HOTPLUG_CPU |
@@ -367,6 +370,7 @@ static void __exit via_cputemp_exit(void) | |||
367 | { | 370 | { |
368 | struct pdev_entry *p, *n; | 371 | struct pdev_entry *p, *n; |
369 | 372 | ||
373 | get_online_cpus(); | ||
370 | unregister_hotcpu_notifier(&via_cputemp_cpu_notifier); | 374 | unregister_hotcpu_notifier(&via_cputemp_cpu_notifier); |
371 | mutex_lock(&pdev_list_mutex); | 375 | mutex_lock(&pdev_list_mutex); |
372 | list_for_each_entry_safe(p, n, &pdev_list, list) { | 376 | list_for_each_entry_safe(p, n, &pdev_list, list) { |
@@ -375,6 +379,7 @@ static void __exit via_cputemp_exit(void) | |||
375 | kfree(p); | 379 | kfree(p); |
376 | } | 380 | } |
377 | mutex_unlock(&pdev_list_mutex); | 381 | mutex_unlock(&pdev_list_mutex); |
382 | put_online_cpus(); | ||
378 | platform_driver_unregister(&via_cputemp_driver); | 383 | platform_driver_unregister(&via_cputemp_driver); |
379 | } | 384 | } |
380 | 385 | ||