aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorChen Gong <gong.chen@linux.intel.com>2010-08-09 20:21:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-08-09 23:45:10 -0400
commit0dca94baeab4a1a514841b0a4c8e3a51dfb4d5ae (patch)
treeb20fdb05c2f5fb9bc7be4065802ca12b024a44f1 /drivers/hwmon
parent4453d7364d3b1f92475f104d4625abee36a7733d (diff)
hwmon: coretemp: update hotplug condition check
Fix two errors in hotplug. One is for hotplug notifier. The other is unnecessary driver unregister. Because even none of online cpus supports coretemp, we can't assume new onlined cpu doesn't support it either. If related driver is unregistered there we have no chance to use coretemp from then on. Signed-off-by: Chen Gong <gong.chen@linux.intel.com> Cc: Rudolf Marek <r.marek@assembler.cz> Cc: Huaxu Wan <huaxu.wan@intel.com> Cc: Jean Delvare <khali@linux-fr.org> Cc: Guenter Roeck <guenter.roeck@ericsson.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/coretemp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 05344af50734..c05dc91ff419 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -502,10 +502,13 @@ static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,
502 502
503 switch (action) { 503 switch (action) {
504 case CPU_ONLINE: 504 case CPU_ONLINE:
505 case CPU_ONLINE_FROZEN:
505 case CPU_DOWN_FAILED: 506 case CPU_DOWN_FAILED:
507 case CPU_DOWN_FAILED_FROZEN:
506 coretemp_device_add(cpu); 508 coretemp_device_add(cpu);
507 break; 509 break;
508 case CPU_DOWN_PREPARE: 510 case CPU_DOWN_PREPARE:
511 case CPU_DOWN_PREPARE_FROZEN:
509 coretemp_device_remove(cpu); 512 coretemp_device_remove(cpu);
510 break; 513 break;
511 } 514 }
@@ -566,7 +569,9 @@ exit_devices_unreg:
566 } 569 }
567 mutex_unlock(&pdev_list_mutex); 570 mutex_unlock(&pdev_list_mutex);
568exit_driver_unreg: 571exit_driver_unreg:
572#ifndef CONFIG_HOTPLUG_CPU
569 platform_driver_unregister(&coretemp_driver); 573 platform_driver_unregister(&coretemp_driver);
574#endif
570exit: 575exit:
571 return err; 576 return err;
572} 577}