diff options
| author | Jiri Slaby <jslaby@suse.cz> | 2012-10-18 16:26:27 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 19:50:12 -0400 |
| commit | 8fcbaa2b7f5b70dba9ed1c7f91d0a270ce752e2c (patch) | |
| tree | 9f85c118012c263aaab73ae1d76fb1df1072b171 /fs/devpts | |
| parent | cee4ad1ed90a0959fc29f9d30a2526e5e9522cfa (diff) | |
TTY: devpts, don't care about TTY in devpts_get_tty
The goal is to stop setting and using tty->driver_data in devpts code.
It should be used solely by the driver's code, pty in this case.
First, here we remove TTY from devpts_get_tty and rename it to
devpts_get_priv. Note we do not remove type safety, we just shift the
[implicit] (void *) cast one layer up.
index was unused in devpts_get_tty, so remove that from the prototype
too.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/devpts')
| -rw-r--r-- | fs/devpts/inode.c | 9 |
1 files changed, 4 insertions, 5 deletions
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 | ||
| 596 | struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number) | 596 | void *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 | ||
| 617 | void devpts_pty_kill(struct tty_struct *tty) | 616 | void devpts_pty_kill(struct tty_struct *tty) |
