aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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/net
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/net')
-rw-r--r--drivers/net/bonding/bond_procfs.c4
-rw-r--r--drivers/net/irda/vlsi_ir.c2
-rw-r--r--drivers/net/wireless/airo.c33
-rw-r--r--drivers/net/wireless/ray_cs.c2
4 files changed, 14 insertions, 27 deletions
diff --git a/drivers/net/bonding/bond_procfs.c b/drivers/net/bonding/bond_procfs.c
index 3cea38d37344..94d06f1307b8 100644
--- a/drivers/net/bonding/bond_procfs.c
+++ b/drivers/net/bonding/bond_procfs.c
@@ -218,15 +218,13 @@ static const struct seq_operations bond_info_seq_ops = {
218static int bond_info_open(struct inode *inode, struct file *file) 218static int bond_info_open(struct inode *inode, struct file *file)
219{ 219{
220 struct seq_file *seq; 220 struct seq_file *seq;
221 struct proc_dir_entry *proc;
222 int res; 221 int res;
223 222
224 res = seq_open(file, &bond_info_seq_ops); 223 res = seq_open(file, &bond_info_seq_ops);
225 if (!res) { 224 if (!res) {
226 /* recover the pointer buried in proc_dir_entry data */ 225 /* recover the pointer buried in proc_dir_entry data */
227 seq = file->private_data; 226 seq = file->private_data;
228 proc = PDE(inode); 227 seq->private = PDE_DATA(inode);
229 seq->private = proc->data;
230 } 228 }
231 229
232 return res; 230 return res;
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index 2f99f8881dfc..e22cd4e7017a 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -383,7 +383,7 @@ static int vlsi_seq_show(struct seq_file *seq, void *v)
383 383
384static int vlsi_seq_open(struct inode *inode, struct file *file) 384static int vlsi_seq_open(struct inode *inode, struct file *file)
385{ 385{
386 return single_open(file, vlsi_seq_show, PDE(inode)->data); 386 return single_open(file, vlsi_seq_show, PDE_DATA(inode));
387} 387}
388 388
389static const struct file_operations vlsi_proc_fops = { 389static const struct file_operations vlsi_proc_fops = {
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 53295418f576..66e398d4730d 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -4663,8 +4663,7 @@ static ssize_t proc_write( struct file *file,
4663static int proc_status_open(struct inode *inode, struct file *file) 4663static int proc_status_open(struct inode *inode, struct file *file)
4664{ 4664{
4665 struct proc_data *data; 4665 struct proc_data *data;
4666 struct proc_dir_entry *dp = PDE(inode); 4666 struct net_device *dev = PDE_DATA(inode);
4667 struct net_device *dev = dp->data;
4668 struct airo_info *apriv = dev->ml_priv; 4667 struct airo_info *apriv = dev->ml_priv;
4669 CapabilityRid cap_rid; 4668 CapabilityRid cap_rid;
4670 StatusRid status_rid; 4669 StatusRid status_rid;
@@ -4746,8 +4745,7 @@ static int proc_stats_rid_open( struct inode *inode,
4746 u16 rid ) 4745 u16 rid )
4747{ 4746{
4748 struct proc_data *data; 4747 struct proc_data *data;
4749 struct proc_dir_entry *dp = PDE(inode); 4748 struct net_device *dev = PDE_DATA(inode);
4750 struct net_device *dev = dp->data;
4751 struct airo_info *apriv = dev->ml_priv; 4749 struct airo_info *apriv = dev->ml_priv;
4752 StatsRid stats; 4750 StatsRid stats;
4753 int i, j; 4751 int i, j;
@@ -4809,8 +4807,7 @@ static inline int sniffing_mode(struct airo_info *ai)
4809static void proc_config_on_close(struct inode *inode, struct file *file) 4807static void proc_config_on_close(struct inode *inode, struct file *file)
4810{ 4808{
4811 struct proc_data *data = file->private_data; 4809 struct proc_data *data = file->private_data;
4812 struct proc_dir_entry *dp = PDE(inode); 4810 struct net_device *dev = PDE_DATA(inode);
4813 struct net_device *dev = dp->data;
4814 struct airo_info *ai = dev->ml_priv; 4811 struct airo_info *ai = dev->ml_priv;
4815 char *line; 4812 char *line;
4816 4813
@@ -5021,8 +5018,7 @@ static const char *get_rmode(__le16 mode)
5021static int proc_config_open(struct inode *inode, struct file *file) 5018static int proc_config_open(struct inode *inode, struct file *file)
5022{ 5019{
5023 struct proc_data *data; 5020 struct proc_data *data;
5024 struct proc_dir_entry *dp = PDE(inode); 5021 struct net_device *dev = PDE_DATA(inode);
5025 struct net_device *dev = dp->data;
5026 struct airo_info *ai = dev->ml_priv; 5022 struct airo_info *ai = dev->ml_priv;
5027 int i; 5023 int i;
5028 __le16 mode; 5024 __le16 mode;
@@ -5112,8 +5108,7 @@ static int proc_config_open(struct inode *inode, struct file *file)
5112static void proc_SSID_on_close(struct inode *inode, struct file *file) 5108static void proc_SSID_on_close(struct inode *inode, struct file *file)
5113{ 5109{
5114 struct proc_data *data = file->private_data; 5110 struct proc_data *data = file->private_data;
5115 struct proc_dir_entry *dp = PDE(inode); 5111 struct net_device *dev = PDE_DATA(inode);
5116 struct net_device *dev = dp->data;
5117 struct airo_info *ai = dev->ml_priv; 5112 struct airo_info *ai = dev->ml_priv;
5118 SsidRid SSID_rid; 5113 SsidRid SSID_rid;
5119 int i; 5114 int i;
@@ -5148,8 +5143,7 @@ static void proc_SSID_on_close(struct inode *inode, struct file *file)
5148 5143
5149static void proc_APList_on_close( struct inode *inode, struct file *file ) { 5144static void proc_APList_on_close( struct inode *inode, struct file *file ) {
5150 struct proc_data *data = file->private_data; 5145 struct proc_data *data = file->private_data;
5151 struct proc_dir_entry *dp = PDE(inode); 5146 struct net_device *dev = PDE_DATA(inode);
5152 struct net_device *dev = dp->data;
5153 struct airo_info *ai = dev->ml_priv; 5147 struct airo_info *ai = dev->ml_priv;
5154 APListRid APList_rid; 5148 APListRid APList_rid;
5155 int i; 5149 int i;
@@ -5283,8 +5277,7 @@ static int set_wep_tx_idx(struct airo_info *ai, u16 index, int perm, int lock)
5283 5277
5284static void proc_wepkey_on_close( struct inode *inode, struct file *file ) { 5278static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
5285 struct proc_data *data; 5279 struct proc_data *data;
5286 struct proc_dir_entry *dp = PDE(inode); 5280 struct net_device *dev = PDE_DATA(inode);
5287 struct net_device *dev = dp->data;
5288 struct airo_info *ai = dev->ml_priv; 5281 struct airo_info *ai = dev->ml_priv;
5289 int i, rc; 5282 int i, rc;
5290 char key[16]; 5283 char key[16];
@@ -5335,8 +5328,7 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
5335static int proc_wepkey_open( struct inode *inode, struct file *file ) 5328static int proc_wepkey_open( struct inode *inode, struct file *file )
5336{ 5329{
5337 struct proc_data *data; 5330 struct proc_data *data;
5338 struct proc_dir_entry *dp = PDE(inode); 5331 struct net_device *dev = PDE_DATA(inode);
5339 struct net_device *dev = dp->data;
5340 struct airo_info *ai = dev->ml_priv; 5332 struct airo_info *ai = dev->ml_priv;
5341 char *ptr; 5333 char *ptr;
5342 WepKeyRid wkr; 5334 WepKeyRid wkr;
@@ -5384,8 +5376,7 @@ static int proc_wepkey_open( struct inode *inode, struct file *file )
5384static int proc_SSID_open(struct inode *inode, struct file *file) 5376static int proc_SSID_open(struct inode *inode, struct file *file)
5385{ 5377{
5386 struct proc_data *data; 5378 struct proc_data *data;
5387 struct proc_dir_entry *dp = PDE(inode); 5379 struct net_device *dev = PDE_DATA(inode);
5388 struct net_device *dev = dp->data;
5389 struct airo_info *ai = dev->ml_priv; 5380 struct airo_info *ai = dev->ml_priv;
5390 int i; 5381 int i;
5391 char *ptr; 5382 char *ptr;
@@ -5428,8 +5419,7 @@ static int proc_SSID_open(struct inode *inode, struct file *file)
5428 5419
5429static int proc_APList_open( struct inode *inode, struct file *file ) { 5420static int proc_APList_open( struct inode *inode, struct file *file ) {
5430 struct proc_data *data; 5421 struct proc_data *data;
5431 struct proc_dir_entry *dp = PDE(inode); 5422 struct net_device *dev = PDE_DATA(inode);
5432 struct net_device *dev = dp->data;
5433 struct airo_info *ai = dev->ml_priv; 5423 struct airo_info *ai = dev->ml_priv;
5434 int i; 5424 int i;
5435 char *ptr; 5425 char *ptr;
@@ -5468,8 +5458,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
5468 5458
5469static int proc_BSSList_open( struct inode *inode, struct file *file ) { 5459static int proc_BSSList_open( struct inode *inode, struct file *file ) {
5470 struct proc_data *data; 5460 struct proc_data *data;
5471 struct proc_dir_entry *dp = PDE(inode); 5461 struct net_device *dev = PDE_DATA(inode);
5472 struct net_device *dev = dp->data;
5473 struct airo_info *ai = dev->ml_priv; 5462 struct airo_info *ai = dev->ml_priv;
5474 char *ptr; 5463 char *ptr;
5475 BSSListRid BSSList_rid; 5464 BSSListRid BSSList_rid;
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 3109c0db66e1..a6f660c01902 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2778,7 +2778,7 @@ static ssize_t int_proc_write(struct file *file, const char __user *buffer,
2778 nr = nr * 10 + c; 2778 nr = nr * 10 + c;
2779 p++; 2779 p++;
2780 } while (--len); 2780 } while (--len);
2781 *(int *)PDE(file_inode(file))->data = nr; 2781 *(int *)PDE_DATA(file_inode(file)) = nr;
2782 return count; 2782 return count;
2783} 2783}
2784 2784