mirror of
https://github.com/torvalds/linux.git
synced 2026-11-26 00:12:52 +00:00
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 <[email protected]> Cc: Rudolf Marek <[email protected]> Cc: Huaxu Wan <[email protected]> Cc: Jean Delvare <[email protected]> Cc: Guenter Roeck <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
committed by
Linus Torvalds
parent
4453d7364d
commit
0dca94baea
@@ -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;
|
||||
}
|
||||
@@ -566,7 +569,9 @@ exit_devices_unreg:
|
||||
}
|
||||
mutex_unlock(&pdev_list_mutex);
|
||||
exit_driver_unreg:
|
||||
#ifndef CONFIG_HOTPLUG_CPU
|
||||
platform_driver_unregister(&coretemp_driver);
|
||||
#endif
|
||||
exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user