Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 323554
b: refs/heads/master
c: a2db672
h: refs/heads/master
v: v3
  • Loading branch information
Silas Boyd-Wickizer authored and Paul E. McKenney committed Sep 23, 2012
1 parent 57cb99d commit 5938cfc
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: 5d18023294abc22984886bd7185344e0c2be0daf
refs/heads/master: a2db672aa305a045404615e5222ba681bab6cf58
5 changes: 5 additions & 0 deletions trunk/arch/x86/kernel/msr.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,14 @@ static int __init msr_init(void)
goto out_chrdev;
}
msr_class->devnode = msr_devnode;
get_online_cpus();
for_each_online_cpu(i) {
err = msr_device_create(i);
if (err != 0)
goto out_class;
}
register_hotcpu_notifier(&msr_class_cpu_notifier);
put_online_cpus();

err = 0;
goto out;
Expand All @@ -271,6 +273,7 @@ static int __init msr_init(void)
i = 0;
for_each_online_cpu(i)
msr_device_destroy(i);
put_online_cpus();
class_destroy(msr_class);
out_chrdev:
__unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr");
Expand All @@ -281,11 +284,13 @@ static int __init msr_init(void)
static void __exit msr_exit(void)
{
int cpu = 0;
get_online_cpus();
for_each_online_cpu(cpu)
msr_device_destroy(cpu);
class_destroy(msr_class);
__unregister_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr");
unregister_hotcpu_notifier(&msr_class_cpu_notifier);
put_online_cpus();
}

module_init(msr_init);
Expand Down

0 comments on commit 5938cfc

Please sign in to comment.