diff options
author | Wang Chen <wangchen@cn.fujitsu.com> | 2008-02-28 14:15:56 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-02-28 14:15:56 -0800 |
commit | 6d37a1581695fba42f4b51e3ff4c2871552cd6d7 (patch) | |
tree | 0532aaeb3898a00f6db9f621481e83a120796a07 /net | |
parent | d45fba3625249fada590a2eea09c38e755a3a2a7 (diff) |
[WANROUTER]: 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')
-rw-r--r-- | 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 f2e54c3f064..5bebe40bf4e 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; } |