Commit 69648d7b authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman

tty: remove BOTHER ifdefs

BOTHER is defined by all architectures since commit d0ffb805
("arch/alpha, termios: implement BOTHER, IBSHIFT and termios2").
Reviewed-by: default avatarJohan Hovold <johan@kernel.org>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20220513082906.11096-3-ilpo.jarvinen@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9fafe733
...@@ -528,7 +528,6 @@ static int mxser_set_baud(struct tty_struct *tty, speed_t newspd) ...@@ -528,7 +528,6 @@ static int mxser_set_baud(struct tty_struct *tty, speed_t newspd)
outb(quot >> 8, info->ioaddr + UART_DLM); /* MS of divisor */ outb(quot >> 8, info->ioaddr + UART_DLM); /* MS of divisor */
outb(cval, info->ioaddr + UART_LCR); /* reset DLAB */ outb(cval, info->ioaddr + UART_LCR); /* reset DLAB */
#ifdef BOTHER
if (C_BAUD(tty) == BOTHER) { if (C_BAUD(tty) == BOTHER) {
quot = MXSER_BAUD_BASE % newspd; quot = MXSER_BAUD_BASE % newspd;
quot *= 8; quot *= 8;
...@@ -539,9 +538,9 @@ static int mxser_set_baud(struct tty_struct *tty, speed_t newspd) ...@@ -539,9 +538,9 @@ static int mxser_set_baud(struct tty_struct *tty, speed_t newspd)
quot /= newspd; quot /= newspd;
mxser_set_must_enum_value(info->ioaddr, quot); mxser_set_must_enum_value(info->ioaddr, quot);
} else } else {
#endif
mxser_set_must_enum_value(info->ioaddr, 0); mxser_set_must_enum_value(info->ioaddr, 0);
}
return 0; return 0;
} }
......
...@@ -61,11 +61,10 @@ speed_t tty_termios_baud_rate(struct ktermios *termios) ...@@ -61,11 +61,10 @@ speed_t tty_termios_baud_rate(struct ktermios *termios)
cbaud = termios->c_cflag & CBAUD; cbaud = termios->c_cflag & CBAUD;
#ifdef BOTHER
/* Magic token for arbitrary speed via c_ispeed/c_ospeed */ /* Magic token for arbitrary speed via c_ispeed/c_ospeed */
if (cbaud == BOTHER) if (cbaud == BOTHER)
return termios->c_ospeed; return termios->c_ospeed;
#endif
if (cbaud & CBAUDEX) { if (cbaud & CBAUDEX) {
cbaud &= ~CBAUDEX; cbaud &= ~CBAUDEX;
...@@ -97,11 +96,11 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios) ...@@ -97,11 +96,11 @@ speed_t tty_termios_input_baud_rate(struct ktermios *termios)
if (cbaud == B0) if (cbaud == B0)
return tty_termios_baud_rate(termios); return tty_termios_baud_rate(termios);
#ifdef BOTHER
/* Magic token for arbitrary speed via c_ispeed*/ /* Magic token for arbitrary speed via c_ispeed*/
if (cbaud == BOTHER) if (cbaud == BOTHER)
return termios->c_ispeed; return termios->c_ispeed;
#endif
if (cbaud & CBAUDEX) { if (cbaud & CBAUDEX) {
cbaud &= ~CBAUDEX; cbaud &= ~CBAUDEX;
...@@ -157,7 +156,6 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, ...@@ -157,7 +156,6 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
if (((termios->c_cflag >> IBSHIFT) & CBAUD) != B0) if (((termios->c_cflag >> IBSHIFT) & CBAUD) != B0)
ibinput = 1; /* An input speed was specified */ ibinput = 1; /* An input speed was specified */
#endif #endif
#ifdef BOTHER
/* If the user asked for a precise weird speed give a precise weird /* If the user asked for a precise weird speed give a precise weird
* answer. If they asked for a Bfoo speed they may have problems * answer. If they asked for a Bfoo speed they may have problems
* digesting non-exact replies so fuzz a bit. * digesting non-exact replies so fuzz a bit.
...@@ -170,7 +168,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, ...@@ -170,7 +168,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
} }
if (((termios->c_cflag >> IBSHIFT) & CBAUD) == BOTHER) if (((termios->c_cflag >> IBSHIFT) & CBAUD) == BOTHER)
iclose = 0; iclose = 0;
#endif
termios->c_cflag &= ~CBAUD; termios->c_cflag &= ~CBAUD;
#ifdef IBSHIFT #ifdef IBSHIFT
termios->c_cflag &= ~(CBAUD << IBSHIFT); termios->c_cflag &= ~(CBAUD << IBSHIFT);
...@@ -205,11 +203,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, ...@@ -205,11 +203,7 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
} }
} while (++i < n_baud_table); } while (++i < n_baud_table);
/* /* If we found no match then use BOTHER. */
* If we found no match then use BOTHER if provided or warn
* the user their platform maintainer needs to wake up if not.
*/
#ifdef BOTHER
if (ofound == -1) if (ofound == -1)
termios->c_cflag |= BOTHER; termios->c_cflag |= BOTHER;
/* Set exact input bits only if the input and output differ or the /* Set exact input bits only if the input and output differ or the
...@@ -217,10 +211,6 @@ void tty_termios_encode_baud_rate(struct ktermios *termios, ...@@ -217,10 +211,6 @@ void tty_termios_encode_baud_rate(struct ktermios *termios,
*/ */
if (ifound == -1 && (ibaud != obaud || ibinput)) if (ifound == -1 && (ibaud != obaud || ibinput))
termios->c_cflag |= (BOTHER << IBSHIFT); termios->c_cflag |= (BOTHER << IBSHIFT);
#else
if (ifound == -1 || ofound == -1)
pr_warn_once("tty: Unable to return correct speed data as your architecture needs updating.\n");
#endif
} }
EXPORT_SYMBOL_GPL(tty_termios_encode_baud_rate); EXPORT_SYMBOL_GPL(tty_termios_encode_baud_rate);
......
...@@ -562,10 +562,8 @@ static int set_sgttyb(struct tty_struct *tty, struct sgttyb __user *sgttyb) ...@@ -562,10 +562,8 @@ static int set_sgttyb(struct tty_struct *tty, struct sgttyb __user *sgttyb)
termios.c_cc[VKILL] = tmp.sg_kill; termios.c_cc[VKILL] = tmp.sg_kill;
set_sgflags(&termios, tmp.sg_flags); set_sgflags(&termios, tmp.sg_flags);
/* Try and encode into Bfoo format */ /* Try and encode into Bfoo format */
#ifdef BOTHER
tty_termios_encode_baud_rate(&termios, termios.c_ispeed, tty_termios_encode_baud_rate(&termios, termios.c_ispeed,
termios.c_ospeed); termios.c_ospeed);
#endif
up_write(&tty->termios_rwsem); up_write(&tty->termios_rwsem);
tty_set_termios(tty, &termios); tty_set_termios(tty, &termios);
return 0; return 0;
......
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