aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hysdn
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/isdn/hysdn
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/isdn/hysdn')
-rw-r--r--drivers/isdn/hysdn/hycapi.c2
-rw-r--r--drivers/isdn/hysdn/hysdn_procconf.c4
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c8
3 files changed, 7 insertions, 7 deletions
diff --git a/drivers/isdn/hysdn/hycapi.c b/drivers/isdn/hysdn/hycapi.c
index 931f916c9c23..00aad10507d8 100644
--- a/drivers/isdn/hysdn/hycapi.c
+++ b/drivers/isdn/hysdn/hycapi.c
@@ -469,7 +469,7 @@ static int hycapi_proc_show(struct seq_file *m, void *v)
469 469
470static int hycapi_proc_open(struct inode *inode, struct file *file) 470static int hycapi_proc_open(struct inode *inode, struct file *file)
471{ 471{
472 return single_open(file, hycapi_proc_show, PDE(inode)->data); 472 return single_open(file, hycapi_proc_show, PDE_DATA(inode));
473} 473}
474 474
475static const struct file_operations hycapi_proc_fops = { 475static const struct file_operations hycapi_proc_fops = {
diff --git a/drivers/isdn/hysdn/hysdn_procconf.c b/drivers/isdn/hysdn/hysdn_procconf.c
index dc88bcb25029..73079213ec94 100644
--- a/drivers/isdn/hysdn/hysdn_procconf.c
+++ b/drivers/isdn/hysdn/hysdn_procconf.c
@@ -234,7 +234,7 @@ hysdn_conf_open(struct inode *ino, struct file *filep)
234 234
235 /* now search the addressed card */ 235 /* now search the addressed card */
236 mutex_lock(&hysdn_conf_mutex); 236 mutex_lock(&hysdn_conf_mutex);
237 card = PDE(ino)->data; 237 card = PDE_DATA(ino);
238 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL)) 238 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
239 hysdn_addlog(card, "config open for uid=%d gid=%d mode=0x%x", 239 hysdn_addlog(card, "config open for uid=%d gid=%d mode=0x%x",
240 filep->f_cred->fsuid, filep->f_cred->fsgid, 240 filep->f_cred->fsuid, filep->f_cred->fsgid,
@@ -308,7 +308,7 @@ hysdn_conf_close(struct inode *ino, struct file *filep)
308 int retval = 0; 308 int retval = 0;
309 309
310 mutex_lock(&hysdn_conf_mutex); 310 mutex_lock(&hysdn_conf_mutex);
311 card = PDE(ino)->data; 311 card = PDE_DATA(ino);
312 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL)) 312 if (card->debug_flags & (LOG_PROC_OPEN | LOG_PROC_ALL))
313 hysdn_addlog(card, "config close for uid=%d gid=%d mode=0x%x", 313 hysdn_addlog(card, "config close for uid=%d gid=%d mode=0x%x",
314 filep->f_cred->fsuid, filep->f_cred->fsgid, 314 filep->f_cred->fsuid, filep->f_cred->fsgid,
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index 22f0e4ef1fb1..b61e8d5e84ad 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -173,7 +173,7 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t *off)
173{ 173{
174 struct log_data *inf; 174 struct log_data *inf;
175 int len; 175 int len;
176 hysdn_card *card = PDE(file_inode(file))->data; 176 hysdn_card *card = PDE_DATA(file_inode(file));
177 177
178 if (!*((struct log_data **) file->private_data)) { 178 if (!*((struct log_data **) file->private_data)) {
179 struct procdata *pd = card->proclog; 179 struct procdata *pd = card->proclog;
@@ -202,7 +202,7 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t *off)
202static int 202static int
203hysdn_log_open(struct inode *ino, struct file *filep) 203hysdn_log_open(struct inode *ino, struct file *filep)
204{ 204{
205 hysdn_card *card = PDE(ino)->data; 205 hysdn_card *card = PDE_DATA(ino);
206 206
207 mutex_lock(&hysdn_log_mutex); 207 mutex_lock(&hysdn_log_mutex);
208 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) { 208 if ((filep->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) {
@@ -255,7 +255,7 @@ hysdn_log_close(struct inode *ino, struct file *filep)
255 pd = (struct procdata *) inf->proc_ctrl; /* still entries there */ 255 pd = (struct procdata *) inf->proc_ctrl; /* still entries there */
256 else { 256 else {
257 /* no info available -> search card */ 257 /* no info available -> search card */
258 card = PDE(file_inode(filep))->data; 258 card = PDE_DATA(file_inode(filep));
259 pd = card->proclog; /* pointer to procfs log */ 259 pd = card->proclog; /* pointer to procfs log */
260 } 260 }
261 if (pd) 261 if (pd)
@@ -286,7 +286,7 @@ static unsigned int
286hysdn_log_poll(struct file *file, poll_table *wait) 286hysdn_log_poll(struct file *file, poll_table *wait)
287{ 287{
288 unsigned int mask = 0; 288 unsigned int mask = 0;
289 hysdn_card *card = PDE(file_inode(file))->data; 289 hysdn_card *card = PDE_DATA(file_inode(file));
290 struct procdata *pd = card->proclog; 290 struct procdata *pd = card->proclog;
291 291
292 if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE) 292 if ((file->f_mode & (FMODE_READ | FMODE_WRITE)) == FMODE_WRITE)