Commit 0dca94baeab4a1a514841b0a4c8e3a51dfb4d5ae

Authored by Chen Gong
Committed by Linus Torvalds
1 parent 4453d7364d

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>

Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff

drivers/hwmon/coretemp.c
... ... @@ -502,10 +502,13 @@
502 502  
503 503 switch (action) {
504 504 case CPU_ONLINE:
  505 + case CPU_ONLINE_FROZEN:
505 506 case CPU_DOWN_FAILED:
  507 + case CPU_DOWN_FAILED_FROZEN:
506 508 coretemp_device_add(cpu);
507 509 break;
508 510 case CPU_DOWN_PREPARE:
  511 + case CPU_DOWN_PREPARE_FROZEN:
509 512 coretemp_device_remove(cpu);
510 513 break;
511 514 }
512 515  
... ... @@ -566,7 +569,9 @@
566 569 }
567 570 mutex_unlock(&pdev_list_mutex);
568 571 exit_driver_unreg:
  572 +#ifndef CONFIG_HOTPLUG_CPU
569 573 platform_driver_unregister(&coretemp_driver);
  574 +#endif
570 575 exit:
571 576 return err;
572 577 }