aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/eeh.c
diff options
context:
space:
mode:
authorDenis V. Lunev <den@openvz.org>2008-04-29 04:02:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-29 11:06:22 -0400
commit667471386d4068e75a6a55b615701ced61eb6333 (patch)
tree2bf51dfa6209ca6637c1cff084b15c132b280ab0 /arch/powerpc/platforms/pseries/eeh.c
parent6f1c86ec315711d21666751b0bdae69ce2c6d589 (diff)
powerpc: 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. Add correct ->owner to proc_fops to fix reading/module unloading race. Signed-off-by: Denis V. Lunev <den@openvz.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Alexey Dobriyan <adobriyan@gmail.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries/eeh.c')
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index a3fd56b186e6..6f544ba4b37f 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -1259,14 +1259,8 @@ static const struct file_operations proc_eeh_operations = {
1259 1259
1260static int __init eeh_init_proc(void) 1260static int __init eeh_init_proc(void)
1261{ 1261{
1262 struct proc_dir_entry *e; 1262 if (machine_is(pseries))
1263 1263 proc_create("ppc64/eeh", 0, NULL, &proc_eeh_operations);
1264 if (machine_is(pseries)) {
1265 e = create_proc_entry("ppc64/eeh", 0, NULL);
1266 if (e)
1267 e->proc_fops = &proc_eeh_operations;
1268 }
1269
1270 return 0; 1264 return 0;
1271} 1265}
1272__initcall(eeh_init_proc); 1266__initcall(eeh_init_proc);