Skip to content

Commit

Permalink
hwmon: coretemp: enable coretemp device add operation failure
Browse files Browse the repository at this point in the history
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 <[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]>
  • Loading branch information
Chen Gong authored and torvalds committed Aug 10, 2010
1 parent 0dca94b commit 851b29c
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions drivers/hwmon/coretemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,9 @@ static int __init coretemp_init(void)
* sensors. We check this bit only, all the early CPUs
* without thermal sensors will be filtered out.
*/
if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01)) {
err = coretemp_device_add(i);
if (err)
goto exit_devices_unreg;

} else {
if (c->cpuid_level >= 6 && (cpuid_eax(0x06) & 0x01))
coretemp_device_add(i);
else {
printk(KERN_INFO DRVNAME ": CPU (model=0x%x)"
" has no thermal sensor.\n", c->x86_model);
}
Expand All @@ -560,14 +557,6 @@ static int __init coretemp_init(void)
#endif
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:
#ifndef CONFIG_HOTPLUG_CPU
platform_driver_unregister(&coretemp_driver);
Expand Down

0 comments on commit 851b29c

Please sign in to comment.