Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323555
b: refs/heads/master
c: 429227b
h: refs/heads/master
i:
  323553: 57cb99d
  323551: 0b6670a
v: v3
  • Loading branch information
Silas Boyd-Wickizer authored and Paul E. McKenney committed Sep 23, 2012
1 parent 5938cfc commit febe797
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2db672aa305a045404615e5222ba681bab6cf58
refs/heads/master: 429227bbe55647aa42f8f63cac61e4544e248629
5 changes: 5 additions & 0 deletions trunk/arch/x86/kernel/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,14 @@ static int __init cpuid_init(void)
goto out_chrdev;
}
cpuid_class->devnode = cpuid_devnode;
get_online_cpus();
for_each_online_cpu(i) {
err = cpuid_device_create(i);
if (err != 0)
goto out_class;
}
register_hotcpu_notifier(&cpuid_class_cpu_notifier);
put_online_cpus();

err = 0;
goto out;
Expand All @@ -214,6 +216,7 @@ static int __init cpuid_init(void)
for_each_online_cpu(i) {
cpuid_device_destroy(i);
}
put_online_cpus();
class_destroy(cpuid_class);
out_chrdev:
__unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid");
Expand All @@ -225,11 +228,13 @@ static void __exit cpuid_exit(void)
{
int cpu = 0;

get_online_cpus();
for_each_online_cpu(cpu)
cpuid_device_destroy(cpu);
class_destroy(cpuid_class);
__unregister_chrdev(CPUID_MAJOR, 0, NR_CPUS, "cpu/cpuid");
unregister_hotcpu_notifier(&cpuid_class_cpu_notifier);
put_online_cpus();
}

module_init(cpuid_init);
Expand Down

0 comments on commit febe797

Please sign in to comment.