Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 227775
b: refs/heads/master
c: ae9e0ce
h: refs/heads/master
i:
  227773: 6a0cc67
  227771: 3ab0978
  227767: 95fda03
  227759: 054a057
  227743: de0353f
  227711: 589d8b2
v: v3
  • Loading branch information
Jan Beulich authored and Guenter Roeck committed Jan 8, 2011
1 parent 04e08c4 commit f64e3ae
Show file tree
Hide file tree
Showing 2 changed files with 12 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: 0f1deb4b820cfacf22492abd7b17e891dafc51ae
refs/heads/master: ae9e0ce73e9fc55a620e0b3bd4a154330a7e64cc
25 changes: 11 additions & 14 deletions trunk/drivers/hwmon/via-cputemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,16 @@ static int __cpuinit via_cputemp_device_add(unsigned int cpu)

static void __cpuinit via_cputemp_device_remove(unsigned int cpu)
{
struct pdev_entry *p, *n;
struct pdev_entry *p;

mutex_lock(&pdev_list_mutex);
list_for_each_entry_safe(p, n, &pdev_list, list) {
list_for_each_entry(p, &pdev_list, list) {
if (p->cpu == cpu) {
platform_device_unregister(p->pdev);
list_del(&p->list);
mutex_unlock(&pdev_list_mutex);
kfree(p);
return;
}
}
mutex_unlock(&pdev_list_mutex);
Expand Down Expand Up @@ -274,7 +277,6 @@ static struct notifier_block via_cputemp_cpu_notifier __refdata = {
static int __init via_cputemp_init(void)
{
int i, err;
struct pdev_entry *p, *n;

if (cpu_data(0).x86_vendor != X86_VENDOR_CENTAUR) {
printk(KERN_DEBUG DRVNAME ": Not a VIA CPU\n");
Expand All @@ -300,28 +302,23 @@ static int __init via_cputemp_init(void)
continue;
}

err = via_cputemp_device_add(i);
if (err)
goto exit_devices_unreg;
via_cputemp_device_add(i);
}

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

register_hotcpu_notifier(&via_cputemp_cpu_notifier);
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(&via_cputemp_driver);
#endif
exit:
return err;
}
Expand Down

0 comments on commit f64e3ae

Please sign in to comment.