Skip to content

Commit 632f32e

Browse files
peterhurleygregkh
authored andcommitted
tty: Remove external interface for tty_set_termios()
tty_set_termios() is an internal helper intended for file scope use. UART drivers which are capable of driving the RTS pin must properly handle the tiocmset() method, regardless of termios settings. A failure to do so is a UART driver bug and should be fixed there. Do not use this interface to workaround UART driver bugs. Cc: Johan Hedberg <[email protected]> Cc: <[email protected]> Signed-off-by: Peter Hurley <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 348f9bb commit 632f32e

File tree

3 files changed

+3
-16
lines changed

3 files changed

+3
-16
lines changed

drivers/bluetooth/hci_ath.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,22 @@ struct ath_struct {
5151

5252
static int ath_wakeup_ar3k(struct tty_struct *tty)
5353
{
54-
struct ktermios ktermios;
5554
int status = tty->driver->ops->tiocmget(tty);
5655

5756
if (status & TIOCM_CTS)
5857
return status;
5958

60-
/* Disable Automatic RTSCTS */
61-
ktermios = tty->termios;
62-
ktermios.c_cflag &= ~CRTSCTS;
63-
tty_set_termios(tty, &ktermios);
64-
6559
/* Clear RTS first */
66-
status = tty->driver->ops->tiocmget(tty);
60+
tty->driver->ops->tiocmget(tty);
6761
tty->driver->ops->tiocmset(tty, 0x00, TIOCM_RTS);
6862
mdelay(20);
6963

7064
/* Set RTS, wake up board */
71-
status = tty->driver->ops->tiocmget(tty);
65+
tty->driver->ops->tiocmget(tty);
7266
tty->driver->ops->tiocmset(tty, TIOCM_RTS, 0x00);
7367
mdelay(20);
7468

7569
status = tty->driver->ops->tiocmget(tty);
76-
77-
/* Enable Automatic RTSCTS */
78-
ktermios.c_cflag |= CRTSCTS;
79-
status = tty_set_termios(tty, &ktermios);
80-
8170
return status;
8271
}
8372

drivers/tty/tty_ioctl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ EXPORT_SYMBOL(tty_termios_hw_change);
530530
* Locking: termios_rwsem
531531
*/
532532

533-
int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
533+
static int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
534534
{
535535
struct ktermios old_termios;
536536
struct tty_ldisc *ld;
@@ -563,7 +563,6 @@ int tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
563563
up_write(&tty->termios_rwsem);
564564
return 0;
565565
}
566-
EXPORT_SYMBOL_GPL(tty_set_termios);
567566

568567
/**
569568
* set_termios - set termios values for a tty

include/linux/tty.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ static inline speed_t tty_get_baud_rate(struct tty_struct *tty)
491491

492492
extern void tty_termios_copy_hw(struct ktermios *new, struct ktermios *old);
493493
extern int tty_termios_hw_change(struct ktermios *a, struct ktermios *b);
494-
extern int tty_set_termios(struct tty_struct *tty, struct ktermios *kt);
495494

496495
extern struct tty_ldisc *tty_ldisc_ref(struct tty_struct *);
497496
extern void tty_ldisc_deref(struct tty_ldisc *);

0 commit comments

Comments
 (0)