aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/tty/pty.c2
-rw-r--r--fs/devpts/inode.c9
-rw-r--r--include/linux/devpts_fs.h7
3 files changed, 8 insertions, 10 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index a82b39939a9c..65f767154d12 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -547,7 +547,7 @@ static struct tty_struct *pts_unix98_lookup(struct tty_driver *driver,
547 struct tty_struct *tty; 547 struct tty_struct *tty;
548 548
549 mutex_lock(&devpts_mutex); 549 mutex_lock(&devpts_mutex);
550 tty = devpts_get_tty(pts_inode, idx); 550 tty = devpts_get_priv(pts_inode);
551 mutex_unlock(&devpts_mutex); 551 mutex_unlock(&devpts_mutex);
552 /* Master must be open before slave */ 552 /* Master must be open before slave */
553 if (!tty) 553 if (!tty)
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c
index 14afbabe6546..47965807884d 100644
--- a/fs/devpts/inode.c
+++ b/fs/devpts/inode.c
@@ -593,10 +593,10 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
593 return ret; 593 return ret;
594} 594}
595 595
596struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number) 596void *devpts_get_priv(struct inode *pts_inode)
597{ 597{
598 struct dentry *dentry; 598 struct dentry *dentry;
599 struct tty_struct *tty; 599 void *priv = NULL;
600 600
601 BUG_ON(pts_inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR)); 601 BUG_ON(pts_inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR));
602 602
@@ -605,13 +605,12 @@ struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number)
605 if (!dentry) 605 if (!dentry)
606 return NULL; 606 return NULL;
607 607
608 tty = NULL;
609 if (pts_inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC) 608 if (pts_inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC)
610 tty = (struct tty_struct *)pts_inode->i_private; 609 priv = pts_inode->i_private;
611 610
612 dput(dentry); 611 dput(dentry);
613 612
614 return tty; 613 return priv;
615} 614}
616 615
617void devpts_pty_kill(struct tty_struct *tty) 616void devpts_pty_kill(struct tty_struct *tty)
diff --git a/include/linux/devpts_fs.h b/include/linux/devpts_fs.h
index 5ce0e5fd712e..de635a5505ea 100644
--- a/include/linux/devpts_fs.h
+++ b/include/linux/devpts_fs.h
@@ -21,8 +21,8 @@ int devpts_new_index(struct inode *ptmx_inode);
21void devpts_kill_index(struct inode *ptmx_inode, int idx); 21void devpts_kill_index(struct inode *ptmx_inode, int idx);
22/* mknod in devpts */ 22/* mknod in devpts */
23int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty); 23int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty);
24/* get tty structure */ 24/* get private structure */
25struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number); 25void *devpts_get_priv(struct inode *pts_inode);
26/* unlink */ 26/* unlink */
27void devpts_pty_kill(struct tty_struct *tty); 27void devpts_pty_kill(struct tty_struct *tty);
28 28
@@ -36,8 +36,7 @@ static inline int devpts_pty_new(struct inode *ptmx_inode,
36{ 36{
37 return -EINVAL; 37 return -EINVAL;
38} 38}
39static inline struct tty_struct *devpts_get_tty(struct inode *pts_inode, 39static inline void *devpts_get_priv(struct inode *pts_inode)
40 int number)
41{ 40{
42 return NULL; 41 return NULL;
43} 42}