Commit 851b29cb3b196cb66452ec964ab5f66c9c9cd1ed

Authored by Chen Gong
Committed by Linus Torvalds
1 parent 0dca94baea

hwmon: coretemp: enable coretemp device add operation failure

If one coretemp device can't be added, it should allow subsequent adding
operation because every new-added device will create a new sysfs group,
not an additional sensor sys entry.

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 3 additions and 14 deletions Side-by-side Diff

drivers/hwmon/coretemp.c
... ... @@ -540,12 +540,9 @@
540 540 * sensors. We check this bit only, all the early CPUs
541 541 * without thermal sensors will be filtered out.
542 542 */
543   - if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01)) {
544   - err = coretemp_device_add(i);
545   - if (err)
546   - goto exit_devices_unreg;
547   -
548   - } else {
  543 + if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01))
  544 + coretemp_device_add(i);
  545 + else {
549 546 printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"
550 547 " has no thermal sensor.\n", c->x86_model);
551 548 }
... ... @@ -560,14 +557,6 @@
560 557 #endif
561 558 return 0;
562 559  
563   -exit_devices_unreg:
564   - mutex_lock(&pdev_list_mutex);
565   - list_for_each_entry_safe(p, n, &pdev_list, list) {
566   - platform_device_unregister(p->pdev);
567   - list_del(&p->list);
568   - kfree(p);
569   - }
570   - mutex_unlock(&pdev_list_mutex);
571 560 exit_driver_unreg:
572 561 #ifndef CONFIG_HOTPLUG_CPU
573 562 platform_driver_unregister(&coretemp_driver);