rtl8192u: Don't need to save device proc dir PDE

Don't need to save the PDE of a directory created under /proc/net/rtl8192/ as
we can use proc subtree deletion to get rid of it and all its children.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cc: Jerry Chuang <jerry-chuang@realtek.com>
cc: linux-wireless@vger.kernel.org
cc: devel@driverdev.osuosl.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
David Howells 2013-04-12 03:02:22 +01:00 коммит произвёл Al Viro
Родитель c4558a26ff
Коммит cc87e0fff1
2 изменённых файлов: 6 добавлений и 13 удалений

Просмотреть файл

@ -946,7 +946,6 @@ typedef struct r8192_priv {
/*stats*/ /*stats*/
struct Stats stats; struct Stats stats;
struct iw_statistics wstats; struct iw_statistics wstats;
struct proc_dir_entry *dir_dev;
/*RX stuff*/ /*RX stuff*/
// u32 *rxring; // u32 *rxring;

Просмотреть файл

@ -669,20 +669,19 @@ static const struct rtl8192_proc_file rtl8192_proc_files[] = {
void rtl8192_proc_init_one(struct net_device *dev) void rtl8192_proc_init_one(struct net_device *dev)
{ {
const struct rtl8192_proc_file *f; const struct rtl8192_proc_file *f;
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); struct proc_dir_entry *dir;
if (rtl8192_proc) { if (rtl8192_proc) {
priv->dir_dev = proc_mkdir_data(dev->name, 0, rtl8192_proc, dev); dir = proc_mkdir_data(dev->name, 0, rtl8192_proc, dev);
if (!priv->dir_dev) { if (!dir) {
RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n", RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n",
dev->name); dev->name);
return; return;
} }
for (f = rtl8192_proc_files; f->name[0]; f++) { for (f = rtl8192_proc_files; f->name[0]; f++) {
if (!proc_create_data(f->name, S_IFREG | S_IRUGO, if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir,
priv->dir_dev, &rtl8192_proc_fops, f->show)) {
rtl8192_proc_fops, f->show)) {
RT_TRACE(COMP_ERR, "Unable to initialize " RT_TRACE(COMP_ERR, "Unable to initialize "
"/proc/net/rtl8192/%s/%s\n", "/proc/net/rtl8192/%s/%s\n",
dev->name, f->name); dev->name, f->name);
@ -694,12 +693,7 @@ void rtl8192_proc_init_one(struct net_device *dev)
void rtl8192_proc_remove_one(struct net_device *dev) void rtl8192_proc_remove_one(struct net_device *dev)
{ {
struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); remove_proc_subtree(dev->name, rtl8192_proc);
if (priv->dir_dev) {
remove_proc_subtree(dev->name, rtl8192_proc);
priv->dir_dev = NULL;
}
} }
/**************************************************************************** /****************************************************************************