diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-29 04:02:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:06:22 -0400 |
commit | c33fff0afbef4f0467c99e3f47ee7e98ae78c77e (patch) | |
tree | d6b5f8dc77aa21de95bbca76c6be6056026cc1d8 /kernel/resource.c | |
parent | ac41cfd19bf77424519b962f8205ede51fceaac6 (diff) |
kernel: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/resource.c')
-rw-r--r-- | kernel/resource.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/kernel/resource.c b/kernel/resource.c index cee12cc47cab..74af2d7cb5a1 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
@@ -131,14 +131,8 @@ static const struct file_operations proc_iomem_operations = { | |||
131 | 131 | ||
132 | static int __init ioresources_init(void) | 132 | static int __init ioresources_init(void) |
133 | { | 133 | { |
134 | struct proc_dir_entry *entry; | 134 | proc_create("ioports", 0, NULL, &proc_ioports_operations); |
135 | 135 | proc_create("iomem", 0, NULL, &proc_iomem_operations); | |
136 | entry = create_proc_entry("ioports", 0, NULL); | ||
137 | if (entry) | ||
138 | entry->proc_fops = &proc_ioports_operations; | ||
139 | entry = create_proc_entry("iomem", 0, NULL); | ||
140 | if (entry) | ||
141 | entry->proc_fops = &proc_iomem_operations; | ||
142 | return 0; | 136 | return 0; |
143 | } | 137 | } |
144 | __initcall(ioresources_init); | 138 | __initcall(ioresources_init); |