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>
This commit is contained in:
Jiri Slaby
2012-10-18 22:26:27 +02:00
committed by Greg Kroah-Hartman
parent cee4ad1ed9
commit 8fcbaa2b7f
3 changed files with 8 additions and 10 deletions

View File

@@ -593,10 +593,10 @@ int devpts_pty_new(struct inode *ptmx_inode, struct tty_struct *tty)
return ret;
}
struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number)
void *devpts_get_priv(struct inode *pts_inode)
{
struct dentry *dentry;
struct tty_struct *tty;
void *priv = NULL;
BUG_ON(pts_inode->i_rdev == MKDEV(TTYAUX_MAJOR, PTMX_MINOR));
@@ -605,13 +605,12 @@ struct tty_struct *devpts_get_tty(struct inode *pts_inode, int number)
if (!dentry)
return NULL;
tty = NULL;
if (pts_inode->i_sb->s_magic == DEVPTS_SUPER_MAGIC)
tty = (struct tty_struct *)pts_inode->i_private;
priv = pts_inode->i_private;
dput(dentry);
return tty;
return priv;
}
void devpts_pty_kill(struct tty_struct *tty)