summaryrefslogtreecommitdiff
path: root/drivers/char/pty.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r--drivers/char/pty.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c
index 45e62e6cf165..2c4933be5f57 100644
--- a/drivers/char/pty.c
+++ b/drivers/char/pty.c
@@ -90,8 +90,7 @@ static void pty_close(struct tty_struct * tty, struct file * filp)
{
unsigned int major = major(tty->device) - UNIX98_PTY_MASTER_MAJOR;
if ( major < UNIX98_NR_MAJORS ) {
- devpts_pty_kill( minor(tty->device)
- - tty->driver->minor_start + tty->driver->name_base );
+ devpts_pty_kill( tty->index + tty->driver->name_base );
}
}
#endif
@@ -238,8 +237,7 @@ static int pty_chars_in_buffer(struct tty_struct *tty)
#ifdef CONFIG_UNIX98_PTYS
static int pty_get_device_number(struct tty_struct *tty, unsigned int *value)
{
- unsigned int result = minor(tty->device)
- - tty->driver->minor_start + tty->driver->name_base;
+ unsigned int result = tty->index + tty->driver->name_base;
return put_user(result, value);
}
#endif
@@ -313,7 +311,7 @@ static int pty_open(struct tty_struct *tty, struct file * filp)
retval = -ENODEV;
if (!tty || !tty->link)
goto out;
- line = minor(tty->device) - tty->driver->minor_start;
+ line = tty->index;
if ((line < 0) || (line >= NR_PTYS))
goto out;
pty = (struct pty_struct *)(tty->driver->driver_state) + line;