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>
This commit is contained in:
committed by
Linus Torvalds
parent
0dca94baea
commit
851b29cb3b
@@ -540,12 +540,9 @@ static int __init coretemp_init(void)
|
|||||||
* sensors. We check this bit only, all the early CPUs
|
* sensors. We check this bit only, all the early CPUs
|
||||||
* without thermal sensors will be filtered out.
|
* without thermal sensors will be filtered out.
|
||||||
*/
|
*/
|
||||||
if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01)) {
|
if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01))
|
||||||
err = coretemp_device_add(i);
|
coretemp_device_add(i);
|
||||||
if (err)
|
else {
|
||||||
goto exit_devices_unreg;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"
|
printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"
|
||||||
" has no thermal sensor.\n", c->x86_model);
|
" has no thermal sensor.\n", c->x86_model);
|
||||||
}
|
}
|
||||||
@@ -560,14 +557,6 @@ static int __init coretemp_init(void)
|
|||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
exit_devices_unreg:
|
|
||||||
mutex_lock(&pdev_list_mutex);
|
|
||||||
list_for_each_entry_safe(p, n, &pdev_list, list) {
|
|
||||||
platform_device_unregister(p->pdev);
|
|
||||||
list_del(&p->list);
|
|
||||||
kfree(p);
|
|
||||||
}
|
|
||||||
mutex_unlock(&pdev_list_mutex);
|
|
||||||
exit_driver_unreg:
|
exit_driver_unreg:
|
||||||
#ifndef CONFIG_HOTPLUG_CPU
|
#ifndef CONFIG_HOTPLUG_CPU
|
||||||
platform_driver_unregister(&coretemp_driver);
|
platform_driver_unregister(&coretemp_driver);
|
||||||
|
Reference in New Issue
Block a user