*/
static int mega_proc_open(struct inode *inode, struct file *file)
{
- adapter_t *adapter = PDE(inode)->parent->data;
+ adapter_t *adapter = proc_get_parent_data(inode);
int (*show)(struct seq_file *, void *) = PDE_DATA(inode);
return single_open(file, show, adapter);
*/
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);
*/
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);
return 0;
}
EXPORT_SYMBOL(remove_proc_subtree);
+
+void *proc_get_parent_data(const struct inode *inode)
+{
+ struct proc_dir_entry *de = PDE(inode);
+ return de->parent->data;
+}
+EXPORT_SYMBOL_GPL(proc_get_parent_data);
extern void proc_set_size(struct proc_dir_entry *, loff_t);
extern void proc_set_user(struct proc_dir_entry *, kuid_t, kgid_t);
+extern void *proc_get_parent_data(const struct inode *);
#else
static inline void proc_flush_task(struct task_struct *task)