aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-03-31 18:16:14 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-04-09 14:13:32 -0400
commitd9dda78bad879595d8c4220a067fc029d6484a16 (patch)
tree376c47ed566b719009e753e917104b150a639b11 /drivers/pnp
parent8510e30b46cd5467b2f930bef68a276dbc2c7d7c (diff)
procfs: new helper - PDE_DATA(inode)
The only part of proc_dir_entry the code outside of fs/proc really cares about is PDE(inode)->data. Provide a helper for that; static inline for now, eventually will be moved to fs/proc, along with the knowledge of struct proc_dir_entry layout. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/pnp')
-rw-r--r--drivers/pnp/isapnp/proc.c4
-rw-r--r--drivers/pnp/pnpbios/proc.c4
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/pnp/isapnp/proc.c b/drivers/pnp/isapnp/proc.c
index 65f735ac6b3b..af4d40affb79 100644
--- a/drivers/pnp/isapnp/proc.c
+++ b/drivers/pnp/isapnp/proc.c
@@ -55,9 +55,7 @@ static loff_t isapnp_proc_bus_lseek(struct file *file, loff_t off, int whence)
55static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf, 55static ssize_t isapnp_proc_bus_read(struct file *file, char __user * buf,
56 size_t nbytes, loff_t * ppos) 56 size_t nbytes, loff_t * ppos)
57{ 57{
58 struct inode *ino = file_inode(file); 58 struct pnp_dev *dev = PDE_DATA(file_inode(file));
59 struct proc_dir_entry *dp = PDE(ino);
60 struct pnp_dev *dev = dp->data;
61 int pos = *ppos; 59 int pos = *ppos;
62 int cnt, size = 256; 60 int cnt, size = 256;
63 61
diff --git a/drivers/pnp/pnpbios/proc.c b/drivers/pnp/pnpbios/proc.c
index 63ddb0173456..8dafd65d4758 100644
--- a/drivers/pnp/pnpbios/proc.c
+++ b/drivers/pnp/pnpbios/proc.c
@@ -238,13 +238,13 @@ static int pnpbios_proc_show(struct seq_file *m, void *v)
238 238
239static int pnpbios_proc_open(struct inode *inode, struct file *file) 239static int pnpbios_proc_open(struct inode *inode, struct file *file)
240{ 240{
241 return single_open(file, pnpbios_proc_show, PDE(inode)->data); 241 return single_open(file, pnpbios_proc_show, PDE_DATA(inode));
242} 242}
243 243
244static ssize_t pnpbios_proc_write(struct file *file, const char __user *buf, 244static ssize_t pnpbios_proc_write(struct file *file, const char __user *buf,
245 size_t count, loff_t *pos) 245 size_t count, loff_t *pos)
246{ 246{
247 void *data = PDE(file_inode(file))->data; 247 void *data = PDE_DATA(file_inode(file));
248 struct pnp_bios_node *node; 248 struct pnp_bios_node *node;
249 int boot = (long)data >> 8; 249 int boot = (long)data >> 8;
250 u8 nodenum = (long)data; 250 u8 nodenum = (long)data;