netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 02/15] [ATM]: Use proc_create() to setup ->proc_fops first
@ 2008-02-28 10:55 Wang Chen
  2008-02-28 21:56 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Chen @ 2008-02-28 10:55 UTC (permalink / raw)
  To: David S. Miller, NETDEV

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>
---
 net/atm/br2684.c    |    4 ++--
 net/atm/clip.c      |    4 +---
 net/atm/lec.c       |    4 +---
 net/atm/mpoa_proc.c |    3 +--
 net/atm/proc.c      |    8 ++++----
 5 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/net/atm/br2684.c b/net/atm/br2684.c
index 574d9a9..1b22806 100644
--- a/net/atm/br2684.c
+++ b/net/atm/br2684.c
@@ -742,9 +742,9 @@ static int __init br2684_init(void)
 {
 #ifdef CONFIG_PROC_FS
 	struct proc_dir_entry *p;
-	if ((p = create_proc_entry("br2684", 0, atm_proc_root)) == NULL)
+	p = proc_create("br2684", 0, atm_proc_root, &br2684_proc_ops);
+	if (p == NULL)
 		return -ENOMEM;
-	p->proc_fops = &br2684_proc_ops;
 #endif
 	register_atm_ioctl(&br2684_ioctl_ops);
 	return 0;
diff --git a/net/atm/clip.c b/net/atm/clip.c
index 86b885e..d30167c 100644
--- a/net/atm/clip.c
+++ b/net/atm/clip.c
@@ -962,9 +962,7 @@ static int __init atm_clip_init(void)
 	{
 		struct proc_dir_entry *p;
 
-		p = create_proc_entry("arp", S_IRUGO, atm_proc_root);
-		if (p)
-			p->proc_fops = &arp_seq_fops;
+		p = proc_create("arp", S_IRUGO, atm_proc_root, &arp_seq_fops);
 	}
 #endif
 
diff --git a/net/atm/lec.c b/net/atm/lec.c
index 1a8c4c6..0e450d1 100644
--- a/net/atm/lec.c
+++ b/net/atm/lec.c
@@ -1249,9 +1249,7 @@ static int __init lane_module_init(void)
 #ifdef CONFIG_PROC_FS
 	struct proc_dir_entry *p;
 
-	p = create_proc_entry("lec", S_IRUGO, atm_proc_root);
-	if (p)
-		p->proc_fops = &lec_seq_fops;
+	p = proc_create("lec", S_IRUGO, atm_proc_root, &lec_seq_fops);
 #endif
 
 	register_atm_ioctl(&lane_ioctl_ops);
diff --git a/net/atm/mpoa_proc.c b/net/atm/mpoa_proc.c
index 91f3ffc..4990541 100644
--- a/net/atm/mpoa_proc.c
+++ b/net/atm/mpoa_proc.c
@@ -276,12 +276,11 @@ int mpc_proc_init(void)
 {
 	struct proc_dir_entry *p;
 
-	p = create_proc_entry(STAT_FILE_NAME, 0, atm_proc_root);
+	p = proc_create(STAT_FILE_NAME, 0, atm_proc_root, &mpc_file_operations);
 	if (!p) {
 		printk(KERN_ERR "Unable to initialize /proc/atm/%s\n", STAT_FILE_NAME);
 		return -ENOMEM;
 	}
-	p->proc_fops = &mpc_file_operations;
 	p->owner = THIS_MODULE;
 	return 0;
 }
diff --git a/net/atm/proc.c b/net/atm/proc.c
index 4912511..e9693ae 100644
--- a/net/atm/proc.c
+++ b/net/atm/proc.c
@@ -435,11 +435,11 @@ int atm_proc_dev_register(struct atm_dev *dev)
 		goto err_out;
 	sprintf(dev->proc_name,"%s:%d",dev->type, dev->number);
 
-	dev->proc_entry = create_proc_entry(dev->proc_name, 0, atm_proc_root);
+	dev->proc_entry = proc_create(dev->proc_name, 0, atm_proc_root,
+				      &proc_atm_dev_ops);
 	if (!dev->proc_entry)
 		goto err_free_name;
 	dev->proc_entry->data = dev;
-	dev->proc_entry->proc_fops = &proc_atm_dev_ops;
 	dev->proc_entry->owner = THIS_MODULE;
 	return 0;
 err_free_name:
@@ -492,10 +492,10 @@ int __init atm_proc_init(void)
 	for (e = atm_proc_ents; e->name; e++) {
 		struct proc_dir_entry *dirent;
 
-		dirent = create_proc_entry(e->name, S_IRUGO, atm_proc_root);
+		dirent = proc_create(e->name, S_IRUGO,
+				     atm_proc_root, e->proc_fops);
 		if (!dirent)
 			goto err_out_remove;
-		dirent->proc_fops = e->proc_fops;
 		dirent->owner = THIS_MODULE;
 		e->dirent = dirent;
 	}
-- 
WCN



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 02/15] [ATM]: Use proc_create() to setup ->proc_fops first
  2008-02-28 10:55 [PATCH 02/15] [ATM]: Use proc_create() to setup ->proc_fops first Wang Chen
@ 2008-02-28 21:56 ` David Miller
  2008-02-29  5:23   ` Wang Chen
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2008-02-28 21:56 UTC (permalink / raw)
  To: wangchen; +Cc: netdev

From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Thu, 28 Feb 2008 18:55:23 +0800

> 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>

Applied, thanks.

Some of those paths could definitely use some error
handling.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 02/15] [ATM]: Use proc_create() to setup ->proc_fops first
  2008-02-28 21:56 ` David Miller
@ 2008-02-29  5:23   ` Wang Chen
  0 siblings, 0 replies; 3+ messages in thread
From: Wang Chen @ 2008-02-29  5:23 UTC (permalink / raw)
  To: David Miller; +Cc: netdev

David Miller said the following on 2008-2-29 5:56:
> From: Wang Chen <wangchen@cn.fujitsu.com>
> Date: Thu, 28 Feb 2008 18:55:23 +0800
> 
>> 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>
> 
> Applied, thanks.
> 
> Some of those paths could definitely use some error
> handling.
> 

Thanks Dave, I will make patch for error handling later.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-29  5:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-28 10:55 [PATCH 02/15] [ATM]: Use proc_create() to setup ->proc_fops first Wang Chen
2008-02-28 21:56 ` David Miller
2008-02-29  5:23   ` Wang Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).