aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-04-11 21:59:48 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-01 17:29:41 -0400
commitc4558a26ff661b5299942ce2b735f3cab4aed1e5 (patch)
treed3becaf9e414a432136d6f924d5e40c334104796
parent270b5ac2151707c25d3327722c5badfbd95945bc (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>
-rw-r--r--drivers/staging/rtl8187se/r8180.h1
-rw-r--r--drivers/staging/rtl8187se/r8180_core.c26
2 files changed, 8 insertions, 19 deletions
diff --git a/drivers/staging/rtl8187se/r8180.h b/drivers/staging/rtl8187se/r8180.h
index 70ea4145b4c8..edacc8001640 100644
--- a/drivers/staging/rtl8187se/r8180.h
+++ b/drivers/staging/rtl8187se/r8180.h
@@ -372,7 +372,6 @@ typedef struct r8180_priv
372 struct Stats stats; 372 struct Stats stats;
373 struct _link_detect_t link_detect; //YJ,add,080828 373 struct _link_detect_t link_detect; //YJ,add,080828
374 struct iw_statistics wstats; 374 struct iw_statistics wstats;
375 struct proc_dir_entry *dir_dev;
376 375
377 /*RX stuff*/ 376 /*RX stuff*/
378 u32 *rxring; 377 u32 *rxring;
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)
288 288
289void rtl8180_proc_remove_one(struct net_device *dev) 289void rtl8180_proc_remove_one(struct net_device *dev)
290{ 290{
291 struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); 291 remove_proc_subtree(dev->name, rtl8180_proc);
292 if (priv->dir_dev) {
293 remove_proc_entry("stats-hw", priv->dir_dev);
294 remove_proc_entry("stats-tx", priv->dir_dev);
295 remove_proc_entry("stats-rx", priv->dir_dev);
296 remove_proc_entry("registers", priv->dir_dev);
297 priv->dir_dev = NULL;
298 }
299} 292}
300 293
301/* 294/*
@@ -335,22 +328,19 @@ static const struct rtl8180_proc_file rtl8180_proc_files[] = {
335void rtl8180_proc_init_one(struct net_device *dev) 328void rtl8180_proc_init_one(struct net_device *dev)
336{ 329{
337 const struct rtl8180_proc_file *f; 330 const struct rtl8180_proc_file *f;
338 struct r8180_priv *priv = (struct r8180_priv *)ieee80211_priv(dev); 331 struct proc_dir_entry *dir;
339 332
340 priv->dir_dev = rtl8180_proc; 333 dir = proc_mkdir_data(dev->name, 0, rtl8180_proc, dev);
341 if (!priv->dir_dev) { 334 if (!dir) {
342 DMESGE("Unable to initialize /proc/net/r8180/%s\n", 335 DMESGE("Unable to initialize /proc/net/r8180/%s\n", dev->name);
343 dev->name);
344 return; 336 return;
345 } 337 }
346 priv->dir_dev->data = dev;
347 338
348 for (f = rtl8180_proc_files; f->name[0]; f++) { 339 for (f = rtl8180_proc_files; f->name[0]; f++) {
349 if (!proc_create_data(f->name, S_IFREG | S_IRUGO, 340 if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
350 priv->dir_dev,
351 &rtl8180_proc_fops, f->show)) { 341 &rtl8180_proc_fops, f->show)) {
352 DMESGE("Unable to initialize /proc/net/r8180/%s\n", 342 DMESGE("Unable to initialize /proc/net/r8180/%s/%s\n",
353 f->name); 343 dev->name, f->name);
354 return; 344 return;
355 } 345 }
356 } 346 }