diff options
| author | Alexander Viro <viro@www.linux.org.uk> | 2003-04-23 04:18:59 -0700 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2003-04-23 04:18:59 -0700 |
| commit | 345127472f366d63f50fdf29b9dd84e70a084bd7 (patch) | |
| tree | e1f47d76d696923a8c1d8baa05e75f97748fda56 /drivers/char/pty.c | |
| parent | 07462df3687e6a58846911460f4f4833fbe3d587 (diff) | |
[PATCH] tty cleanups (6/12)
tty->tty_index added; we initialize it with minor(tty->device) -
tty->driver->minor_start. Majority of remaining tty->device uses had
that form and are switched to use of tty->index.
Diffstat (limited to 'drivers/char/pty.c')
| -rw-r--r-- | drivers/char/pty.c | 8 |
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; |
