summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2013-04-12 14:06:01 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2013-05-01 17:29:42 -0400
commit4a520d2769beb736ba2bd084b8293ce148a1a7ae (patch)
tree023a339c1f2ecf7bd1b051a725f4c720f1908c0f /drivers/staging
parentb25f774d889e3856c6d81ffc679912f8bdef6adc (diff)
proc: Supply an accessor for getting the data from a PDE's parent
Supply an accessor function for getting the private data from the parent proc_dir_entry struct of the proc_dir_entry struct associated with an inode. ReiserFS, for instance, stores the super_block pointer in the proc directory it makes for that super_block, and a pointer to the respective seq_file show function in each of the proc files in that directory. This allows a reduction in the number of file_operations structs, open functions and seq_operations structs required. The problem otherwise is that each show function requires two pieces of data but only has storage for one per PDE (and this has no release function). 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: Maxim Mikityanskiy <maxtram95@gmail.com> cc: YAMANE Toshiaki <yamanetoshi@gmail.com> cc: linux-wireless@vger.kernel.org cc: linux-scsi@vger.kernel.org cc: devel@driverdev.osuosl.org Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/rtl8187se/r8180_core.c2
-rw-r--r--drivers/staging/rtl8192u/r8192U_core.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c
index ab469ceae88c..f7c1d9905ec6 100644
--- a/drivers/staging/rtl8187se/r8180_core.c
+++ b/drivers/staging/rtl8187se/r8180_core.c
@@ -296,7 +296,7 @@ void rtl8180_proc_remove_one(struct net_device *dev)
*/
static int rtl8180_proc_open(struct inode *inode, struct file *file)
{
- struct net_device *dev = PDE(inode)->parent->data;
+ struct net_device *dev = proc_get_parent_data(inode);
int (*show)(struct seq_file *, void *) = PDE_DATA(inode);
return single_open(file, show, dev);
diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
index 27ba2a3111d2..145923397556 100644
--- a/drivers/staging/rtl8192u/r8192U_core.c
+++ b/drivers/staging/rtl8192u/r8192U_core.c
@@ -637,7 +637,7 @@ void rtl8192_proc_module_remove(void)
*/
static int rtl8192_proc_open(struct inode *inode, struct file *file)
{
- struct net_device *dev = PDE(inode)->parent->data;
+ struct net_device *dev = proc_get_parent_data(inode);
int (*show)(struct seq_file *, void *) = PDE_DATA(inode);
return single_open(file, show, dev);