Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 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 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>

authored by

Johan Hovold and committed by
Greg Kroah-Hartman
6086380a 85357965

+3 -20
+3 -20
drivers/tty/amiserial.c
··· 570 570 info->xmit.head = info->xmit.tail = 0; 571 571 572 572 /* 573 - * Set up the tty->alt_speed kludge 574 - */ 575 - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) 576 - tty->alt_speed = 57600; 577 - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) 578 - tty->alt_speed = 115200; 579 - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) 580 - tty->alt_speed = 230400; 581 - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) 582 - tty->alt_speed = 460800; 583 - 584 - /* 585 573 * and set the speed of the serial port 586 574 */ 587 575 change_speed(tty, info, NULL); ··· 1072 1084 check_and_exit: 1073 1085 if (tty_port_initialized(port)) { 1074 1086 if (change_spd) { 1075 - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_HI) 1076 - tty->alt_speed = 57600; 1077 - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_VHI) 1078 - tty->alt_speed = 115200; 1079 - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_SHI) 1080 - tty->alt_speed = 230400; 1081 - if ((port->flags & ASYNC_SPD_MASK) == ASYNC_SPD_WARP) 1082 - tty->alt_speed = 460800; 1087 + /* warn about deprecation unless clearing */ 1088 + if (new_serial.flags & ASYNC_SPD_MASK) 1089 + dev_warn_ratelimited(tty->dev, "use of SPD flags is deprecated\n"); 1083 1090 change_speed(tty, state, NULL); 1084 1091 } 1085 1092 } else