Commit ea1afd25 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

tty: fix up gigaset a bit

Stephen's fixes reminded me that gigaset is still rather broken so fix it up
a bit
Signed-off-by: default avatarAlan Cox <alan@redhat.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 53e86317
...@@ -571,6 +571,7 @@ gigaset_tty_close(struct tty_struct *tty) ...@@ -571,6 +571,7 @@ gigaset_tty_close(struct tty_struct *tty)
} }
/* prevent other callers from entering ldisc methods */ /* prevent other callers from entering ldisc methods */
/* FIXME: should use the tty state flags */
tty->disc_data = NULL; tty->disc_data = NULL;
if (!cs->hw.ser) if (!cs->hw.ser)
...@@ -642,10 +643,11 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -642,10 +643,11 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file,
return -ENXIO; return -ENXIO;
switch (cmd) { switch (cmd) {
case TCGETS:
case TCGETA: case FIONREAD:
/* pass through to underlying serial device */ /* unused, always return zero */
rc = n_tty_ioctl_helper(tty, file, cmd, arg); val = 0;
rc = put_user(val, p);
break; break;
case TCFLSH: case TCFLSH:
...@@ -659,20 +661,13 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -659,20 +661,13 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file,
flush_send_queue(cs); flush_send_queue(cs);
break; break;
} }
/* flush the serial port's buffer */ /* Pass through */
rc = n_tty_ioctl_helper(tty, file, cmd, arg);
break;
case FIONREAD:
/* unused, always return zero */
val = 0;
rc = put_user(val, p);
break;
default: default:
rc = -ENOIOCTLCMD; /* pass through to underlying serial device */
rc = n_tty_ioctl_helper(tty, file, cmd, arg);
break;
} }
cs_put(cs); cs_put(cs);
return rc; return rc;
} }
...@@ -680,6 +675,8 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file, ...@@ -680,6 +675,8 @@ gigaset_tty_ioctl(struct tty_struct *tty, struct file *file,
/* /*
* Poll on the tty. * Poll on the tty.
* Unused, always return zero. * Unused, always return zero.
*
* FIXME: should probably return an exception - especially on hangup
*/ */
static unsigned int static unsigned int
gigaset_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait) gigaset_tty_poll(struct tty_struct *tty, struct file *file, poll_table *wait)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment