Commit 6086380a authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

tty: amiserial: 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 6865ff22 ("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 change speed as being deprecated.

Note that using ASYNC_SPD_CUST is still supported.
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: default avatarAlan Cox <alan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85357965
...@@ -569,18 +569,6 @@ static int startup(struct tty_struct *tty, struct serial_state *info) ...@@ -569,18 +569,6 @@ static int startup(struct tty_struct *tty, struct serial_state *info)
clear_bit(TTY_IO_ERROR, &tty->flags); clear_bit(TTY_IO_ERROR, &tty->flags);
info->xmit.head = info->xmit.tail = 0; info->xmit.head = info->xmit.tail = 0;
/*
* Set up the tty->alt_speed kludge
*/
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI)
tty->alt_speed = 57600;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI)
tty->alt_speed = 115200;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
tty->alt_speed = 230400;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
tty->alt_speed = 460800;
/* /*
* and set the speed of the serial port * and set the speed of the serial port
*/ */
...@@ -1084,14 +1072,9 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state, ...@@ -1084,14 +1072,9 @@ static int set_serial_info(struct tty_struct *tty, struct serial_state *state,
check_and_exit: check_and_exit:
if (tty_port_initialized(port)) { if (tty_port_initialized(port)) {
if (change_spd) { if (change_spd) {
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) /* warn about deprecation unless clearing */
tty->alt_speed = 57600; if (new_serial.flags & ASYNC_SPD_MASK)
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) dev_warn_ratelimited(tty->dev, "use of SPD flags is deprecated\n");
tty->alt_speed = 115200;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI)
tty->alt_speed = 230400;
if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP)
tty->alt_speed = 460800;
change_speed(tty, state, NULL); change_speed(tty, state, NULL);
} }
} else } else
......
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