From 5e47879f493e14a017d1facefc601f43c477dbee Mon Sep 17 00:00:00 2001 From: Wang Chen Date: Fri, 29 Feb 2008 10:34:45 -0800 Subject: [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 Signed-off-by: David S. Miller --- net/irda/ircomm/ircomm_core.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'net/irda/ircomm') diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index b825399fc160..6eef1f2a7553 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 */ -- cgit v1.2.3-59-g8ed1b