From: David Howells Date: Fri, 12 Apr 2013 02:02:22 +0000 (+0100) Subject: rtl8192u: Don't need to save device proc dir PDE X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cc87e0fff1e639c4c7832075b8cdd89ab30d2a1f;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Acked-by: Mauro Carvalho Chehab Acked-by: Greg Kroah-Hartman cc: Jerry Chuang cc: linux-wireless@vger.kernel.org cc: devel@driverdev.osuosl.org Signed-off-by: Al Viro --- diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h index e538e026b512..bedeb330ad4f 100644 --- a/drivers/staging/rtl8192u/r8192U.h +++ b/drivers/staging/rtl8192u/r8192U.h @@ -946,7 +946,6 @@ typedef struct r8192_priv { /*stats*/ struct Stats stats; struct iw_statistics wstats; - struct proc_dir_entry *dir_dev; /*RX stuff*/ // u32 *rxring; diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c index d81d7d55f25e..27ba2a3111d2 100644 --- a/drivers/staging/rtl8192u/r8192U_core.c +++ b/drivers/staging/rtl8192u/r8192U_core.c @@ -669,20 +669,19 @@ static const struct rtl8192_proc_file rtl8192_proc_files[] = { void rtl8192_proc_init_one(struct net_device *dev) { const struct rtl8192_proc_file *f; - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); + struct proc_dir_entry *dir; if (rtl8192_proc) { - priv->dir_dev = proc_mkdir_data(dev->name, 0, rtl8192_proc, dev); - if (!priv->dir_dev) { + dir = proc_mkdir_data(dev->name, 0, rtl8192_proc, dev); + if (!dir) { RT_TRACE(COMP_ERR, "Unable to initialize /proc/net/rtl8192/%s\n", dev->name); return; } for (f = rtl8192_proc_files; f->name[0]; f++) { - if (!proc_create_data(f->name, S_IFREG | S_IRUGO, - priv->dir_dev, - rtl8192_proc_fops, f->show)) { + if (!proc_create_data(f->name, S_IFREG | S_IRUGO, dir, + &rtl8192_proc_fops, f->show)) { RT_TRACE(COMP_ERR, "Unable to initialize " "/proc/net/rtl8192/%s/%s\n", 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) { - struct r8192_priv *priv = (struct r8192_priv *)ieee80211_priv(dev); - - if (priv->dir_dev) { - remove_proc_subtree(dev->name, rtl8192_proc); - priv->dir_dev = NULL; - } + remove_proc_subtree(dev->name, rtl8192_proc); } /****************************************************************************