Skip to content

Commit

Permalink
hwmon: coretemp: update hotplug condition check
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chen Gong authored and Linus Torvalds committed Aug 10, 2010
1 parent 4453d73 commit 0dca94b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/hwmon/coretemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,13 @@ static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,

switch (action) {
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
case CPU_DOWN_FAILED:
case CPU_DOWN_FAILED_FROZEN:
coretemp_device_add(cpu);
break;
case CPU_DOWN_PREPARE:
case CPU_DOWN_PREPARE_FROZEN:
coretemp_device_remove(cpu);
break;
}
Expand Down Expand Up @@ -566,7 +569,9 @@ static int __init coretemp_init(void)
}
mutex_unlock(&pdev_list_mutex);
exit_driver_unreg:
#ifndef CONFIG_HOTPLUG_CPU
platform_driver_unregister(&coretemp_driver);
#endif
exit:
return err;
}
Expand Down

0 comments on commit 0dca94b

Please sign in to comment.