Commit 6d37a158 authored by Wang Chen's avatar Wang Chen Committed by David S. Miller

[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: default avatarWang Chen <wangchen@cn.fujitsu.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d45fba36
...@@ -292,14 +292,12 @@ int __init wanrouter_proc_init(void) ...@@ -292,14 +292,12 @@ int __init wanrouter_proc_init(void)
if (!proc_router) if (!proc_router)
goto fail; goto fail;
p = create_proc_entry("config", S_IRUGO, proc_router); p = proc_create("config", S_IRUGO, proc_router, &config_fops);
if (!p) if (!p)
goto fail_config; goto fail_config;
p->proc_fops = &config_fops; p = proc_create("status", S_IRUGO, proc_router, &status_fops);
p = create_proc_entry("status", S_IRUGO, proc_router);
if (!p) if (!p)
goto fail_stat; goto fail_stat;
p->proc_fops = &status_fops;
return 0; return 0;
fail_stat: fail_stat:
remove_proc_entry("config", proc_router); remove_proc_entry("config", proc_router);
...@@ -329,10 +327,10 @@ int wanrouter_proc_add(struct wan_device* wandev) ...@@ -329,10 +327,10 @@ int wanrouter_proc_add(struct wan_device* wandev)
if (wandev->magic != ROUTER_MAGIC) if (wandev->magic != ROUTER_MAGIC)
return -EINVAL; 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) if (!wandev->dent)
return -ENOMEM; return -ENOMEM;
wandev->dent->proc_fops = &wandev_fops;
wandev->dent->data = wandev; wandev->dent->data = wandev;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment