diff options
author | Johan Hovold <johan@kernel.org> | 2017-06-06 12:54:38 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-06-13 11:49:58 +0200 |
commit | d1b8bc3bc27c2ce7b359ebf084065b2b9468c04d (patch) | |
tree | c80a05292c811111d7f1f29b39327d8c4239c1c2 /drivers/tty | |
parent | 6086380a5576239bd5bfaa175364550b38223ba6 (diff) | |
download | op-kernel-dev-d1b8bc3bc27c2ce7b359ebf084065b2b9468c04d.zip op-kernel-dev-d1b8bc3bc27c2ce7b359ebf084065b2b9468c04d.tar.gz |
tty: cyclades: drop broken alt-speed support
Setting an alt_speed using the ASYNC_SPD flags has been deprecated since
v2.1.69, and has been broken since v3.10 and commit 6865ff222cca ("TTY:
do not warn about setting speed via SPD_*") without anyone noticing.
Drop the broken alt-speed handling altogether, and add a ratelimited
warning about using TIOCCSERIAL to to change speed as being deprecated.
Note that using ASYNC_SPD_CUST is still supported.
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/cyclades.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c index 104f09c..d272bc4 100644 --- a/drivers/tty/cyclades.c +++ b/drivers/tty/cyclades.c @@ -1975,18 +1975,6 @@ static void cy_set_line_char(struct cyclades_port *info, struct tty_struct *tty) cflag = tty->termios.c_cflag; iflag = tty->termios.c_iflag; - /* - * Set up the tty->alt_speed kludge - */ - if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) - tty->alt_speed = 57600; - if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) - tty->alt_speed = 115200; - if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) - tty->alt_speed = 230400; - if ((info->port.flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) - tty->alt_speed = 460800; - card = info->card; channel = info->line - card->first_line; @@ -2295,12 +2283,16 @@ cy_set_serial_info(struct cyclades_port *info, struct tty_struct *tty, struct serial_struct __user *new_info) { struct serial_struct new_serial; + int old_flags; int ret; if (copy_from_user(&new_serial, new_info, sizeof(new_serial))) return -EFAULT; mutex_lock(&info->port.mutex); + + old_flags = info->port.flags; + if (!capable(CAP_SYS_ADMIN)) { if (new_serial.close_delay != info->port.close_delay || new_serial.baud_base != info->baud || @@ -2332,6 +2324,11 @@ cy_set_serial_info(struct cyclades_port *info, struct tty_struct *tty, check_and_exit: if (tty_port_initialized(&info->port)) { + if ((new_serial.flags ^ old_flags) & ASYNC_SPD_MASK) { + /* warn about deprecation unless clearing */ + if (new_serial.flags & ASYNC_SPD_MASK) + dev_warn_ratelimited(tty->dev, "use of SPD flags is deprecated\n"); + } cy_set_line_char(info, tty); ret = 0; } else { |