Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217100
b: refs/heads/master
c: fd53d08
h: refs/heads/master
v: v3
  • Loading branch information
Chen Gong authored and Guenter Roeck committed Oct 25, 2010
1 parent bf08a48 commit 8c86b05
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e5f5c99a39375ce533aacfdfb269978070121e1c
refs/heads/master: fd53d08465a79d742a297be1d7d173f8a13972a6
22 changes: 8 additions & 14 deletions trunk/drivers/hwmon/pkgtemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/cpu.h>
#include <asm/msr.h>
#include <asm/processor.h>
#include <asm/smp.h>

#define DRVNAME "pkgtemp"

Expand Down Expand Up @@ -391,7 +392,6 @@ static struct notifier_block pkgtemp_cpu_notifier __refdata = {
static int __init pkgtemp_init(void)
{
int i, err = -ENODEV;
struct pdev_entry *p, *n;

/* quick check if we run Intel */
if (cpu_data(0).x86_vendor != X86_VENDOR_INTEL)
Expand All @@ -401,31 +401,25 @@ static int __init pkgtemp_init(void)
if (err)
goto exit;

for_each_online_cpu(i) {
err = pkgtemp_device_add(i);
if (err)
goto exit_devices_unreg;
}
for_each_online_cpu(i)
pkgtemp_device_add(i);

#ifndef CONFIG_HOTPLUG_CPU
if (list_empty(&pdev_list)) {
err = -ENODEV;
goto exit_driver_unreg;
}
#endif

#ifdef CONFIG_HOTPLUG_CPU
register_hotcpu_notifier(&pkgtemp_cpu_notifier);
#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);
#ifndef CONFIG_HOTPLUG_CPU
exit_driver_unreg:
platform_driver_unregister(&pkgtemp_driver);
#endif
exit:
return err;
}
Expand Down

0 comments on commit 8c86b05

Please sign in to comment.