Skip to content

Commit

Permalink
s390/3270: readd tty3270_open
Browse files Browse the repository at this point in the history
Reintroduce the tty3270_open function which has been removed by
git commit 20cda6f "TTY: tty3270, add tty install". Without
the open function in the tty_operations tty_open will return
-ENODEV and the 3270 tty will not work.

Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
  • Loading branch information
Martin Schwidefsky committed Feb 14, 2013
1 parent 7292e7e commit 736c9fd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions drivers/s390/char/tty3270.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,20 @@ static int tty3270_install(struct tty_driver *driver, struct tty_struct *tty)
return 0;
}

/*
* This routine is called whenever a 3270 tty is opened.
*/
static int
tty3270_open(struct tty_struct *tty, struct file *filp)
{
struct tty3270 *tp = tty->driver_data;
struct tty_port *port = &tp->port;

port->count++;
tty_port_tty_set(port, tty);
return 0;
}

/*
* This routine is called when the 3270 tty is closed. We wait
* for the remaining request to be completed. Then we clean up.
Expand Down Expand Up @@ -1753,6 +1767,7 @@ static long tty3270_compat_ioctl(struct tty_struct *tty,
static const struct tty_operations tty3270_ops = {
.install = tty3270_install,
.cleanup = tty3270_cleanup,
.open = tty3270_open,
.close = tty3270_close,
.write = tty3270_write,
.put_char = tty3270_put_char,
Expand Down

0 comments on commit 736c9fd

Please sign in to comment.