summaryrefslogtreecommitdiff
path: root/net/irda
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-02-29 10:34:45 -0800
committerDavid S. Miller <davem@davemloft.net>2008-02-29 10:34:45 -0800
commit5e47879f493e14a017d1facefc601f43c477dbee (patch)
tree268397e6e7af11d05d929bdf10306fa16701e279 /net/irda
parent0bc8c7bf9e7440500fe04f95d6cddc58ea023cd2 (diff)
[IRDA]: Use proc_create() to setup ->proc_fops first
Use proc_create() to make sure that ->proc_fops be setup before gluing PDE to main tree. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/irda')
-rw-r--r--net/irda/ircomm/ircomm_core.c8
-rw-r--r--net/irda/irlan/irlan_common.c4
-rw-r--r--net/irda/irproc.c8
3 files changed, 9 insertions, 11 deletions
diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c
index b825399fc16..6eef1f2a755 100644
--- a/net/irda/ircomm/ircomm_core.c
+++ b/net/irda/ircomm/ircomm_core.c
@@ -76,9 +76,11 @@ static int __init ircomm_init(void)
#ifdef CONFIG_PROC_FS
{ struct proc_dir_entry *ent;
- ent = create_proc_entry("ircomm", 0, proc_irda);
- if (ent)
- ent->proc_fops = &ircomm_proc_fops;
+ ent = proc_create("ircomm", 0, proc_irda, &ircomm_proc_fops);
+ if (!ent) {
+ printk(KERN_ERR "ircomm_init: can't create /proc entry!\n");
+ return -ENODEV;
+ }
}
#endif /* CONFIG_PROC_FS */
diff --git a/net/irda/irlan/irlan_common.c b/net/irda/irlan/irlan_common.c
index a4b56e25a91..1eb4bbcb1c9 100644
--- a/net/irda/irlan/irlan_common.c
+++ b/net/irda/irlan/irlan_common.c
@@ -128,13 +128,11 @@ static int __init irlan_init(void)
#ifdef CONFIG_PROC_FS
{ struct proc_dir_entry *proc;
- proc = create_proc_entry("irlan", 0, proc_irda);
+ proc = proc_create("irlan", 0, proc_irda, &irlan_fops);
if (!proc) {
printk(KERN_ERR "irlan_init: can't create /proc entry!\n");
return -ENODEV;
}
-
- proc->proc_fops = &irlan_fops;
}
#endif /* CONFIG_PROC_FS */
diff --git a/net/irda/irproc.c b/net/irda/irproc.c
index cae24fbda96..88e80a31273 100644
--- a/net/irda/irproc.c
+++ b/net/irda/irproc.c
@@ -72,11 +72,9 @@ void __init irda_proc_register(void)
return;
proc_irda->owner = THIS_MODULE;
- for (i=0; i<ARRAY_SIZE(irda_dirs); i++) {
- d = create_proc_entry(irda_dirs[i].name, 0, proc_irda);
- if (d)
- d->proc_fops = irda_dirs[i].fops;
- }
+ for (i = 0; i < ARRAY_SIZE(irda_dirs); i++)
+ d = proc_create(irda_dirs[i].name, 0, proc_irda,
+ irda_dirs[i].fops);
}
/*