diff options
author | David Howells <dhowells@redhat.com> | 2013-04-12 02:59:48 +0100 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-01 17:29:41 -0400 |
commit | c4558a26ff661b5299942ce2b735f3cab4aed1e5 (patch) | |
tree | d3becaf9e414a432136d6f924d5e40c334104796 /drivers/staging/rtl8187se/r8180_core.c | |
parent | 270b5ac2151707c25d3327722c5badfbd95945bc (diff) |
rtl8187se: Use a dir under /proc/net/r8180/
Create a dir under /proc/net/r8180/ named for the device and create that
device's files under there. This means that there won't be a problem for
multiple devices in the system (if such is possible) and it means we don't
need to save the 'device directory' PDE any more as we can just do a proc
subtree removal.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Maxim Mikityanskiy <maxtram95@gmail.com>
cc: YAMANE Toshiaki <yamanetoshi@gmail.com>
cc: linux-wireless@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/staging/rtl8187se/r8180_core.c')
-rw-r--r-- | drivers/staging/rtl8187se/r8180_core.c | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index 448da77e2cd1..ab469ceae88c 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c @@ -288,14 +288,7 @@ void rtl8180_proc_module_remove(void) void rtl8180_proc_remove_one(struct net_device *dev) { - struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); - if (priv->dir_dev) { - remove_proc_entry("stats-hw", priv->dir_dev); - remove_proc_entry("stats-tx", priv->dir_dev); - remove_proc_entry("stats-rx", priv->dir_dev); - remove_proc_entry("registers", priv->dir_dev); - priv->dir_dev = NULL; - } + remove_proc_subtree(dev->name, rtl8180_proc); } /* @@ -335,22 +328,19 @@ static const struct rtl8180_proc_file rtl8180_proc_files[] = { void rtl8180_proc_init_one(struct net_device *dev) { const struct rtl8180_proc_file *f; - struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); + struct proc_dir_entry *dir; - priv->dir_dev = rtl8180_proc; - if (!priv->dir_dev) { - DMESGE("Unable to initialize /proc/net/r8180/%s\n", - dev->name); + dir = proc_mkdir_data(dev->name, 0, rtl8180_proc, dev); + if (!dir) { + DMESGE("Unable to initialize /proc/net/r8180/%s\n", dev->name); return; } - priv->dir_dev->data = dev; for (f = rtl8180_proc_files; f->name[0]; f++) { - if (!proc_create_data(f->name, S_IFREG | S_IRUGO, - priv->dir_dev, + if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir, &rtl8180_proc_fops, f->show)) { - DMESGE("Unable to initialize /proc/net/r8180/%s\n", - f->name); + DMESGE("Unable to initialize /proc/net/r8180/%s/%s\n", + dev->name, f->name); return; } } |