* [PATCH 14/15] [WANROUTER]: Use proc_create() to setup ->proc_fops first
@ 2008-02-28 10:58 Wang Chen
2008-02-28 22:16 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Wang Chen @ 2008-02-28 10:58 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/wanrouter/wanproc.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/wanrouter/wanproc.c b/net/wanrouter/wanproc.c
index f2e54c3..5bebe40 100644
--- a/net/wanrouter/wanproc.c
+++ b/net/wanrouter/wanproc.c
@@ -292,14 +292,12 @@ int __init wanrouter_proc_init(void)
if (!proc_router)
goto fail;
- p = create_proc_entry("config", S_IRUGO, proc_router);
+ p = proc_create("config", S_IRUGO, proc_router, &config_fops);
if (!p)
goto fail_config;
- p->proc_fops = &config_fops;
- p = create_proc_entry("status", S_IRUGO, proc_router);
+ p = proc_create("status", S_IRUGO, proc_router, &status_fops);
if (!p)
goto fail_stat;
- p->proc_fops = &status_fops;
return 0;
fail_stat:
remove_proc_entry("config", proc_router);
@@ -329,10 +327,10 @@ int wanrouter_proc_add(struct wan_device* wandev)
if (wandev->magic != ROUTER_MAGIC)
return -EINVAL;
- wandev->dent = create_proc_entry(wandev->name, S_IRUGO, proc_router);
+ wandev->dent = proc_create(wandev->name, S_IRUGO,
+ proc_router, &wandev_fops);
if (!wandev->dent)
return -ENOMEM;
- wandev->dent->proc_fops = &wandev_fops;
wandev->dent->data = wandev;
return 0;
}
--
WCN
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 14/15] [WANROUTER]: Use proc_create() to setup ->proc_fops first
2008-02-28 10:58 [PATCH 14/15] [WANROUTER]: Use proc_create() to setup ->proc_fops first Wang Chen
@ 2008-02-28 22:16 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-02-28 22:16 UTC (permalink / raw)
To: wangchen; +Cc: netdev
From: Wang Chen <wangchen@cn.fujitsu.com>
Date: Thu, 28 Feb 2008 18:58:35 +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.
> @@ -329,10 +327,10 @@ int wanrouter_proc_add(struct wan_device* wandev)
> if (wandev->magic != ROUTER_MAGIC)
> return -EINVAL;
>
> - wandev->dent = create_proc_entry(wandev->name, S_IRUGO, proc_router);
> + wandev->dent = proc_create(wandev->name, S_IRUGO,
> + proc_router, &wandev_fops);
> if (!wandev->dent)
> return -ENOMEM;
> - wandev->dent->proc_fops = &wandev_fops;
> wandev->dent->data = wandev;
> return 0;
> }
->data visibility issue
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-02-28 22:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-28 10:58 [PATCH 14/15] [WANROUTER]: Use proc_create() to setup ->proc_fops first Wang Chen
2008-02-28 22:16 ` David Miller
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).