Skip to content

Commit

Permalink
Bluetooth: hci_ldisc: Fix tty_set_termios() return value assumptions
Browse files Browse the repository at this point in the history
tty_set_termios() never returns anything else than 0. Make the debug
prints to look directly into the new termios instead to check CRTSCTS
state.

Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Ilpo Järvinen authored and Luiz Augusto von Dentz committed Apr 7, 2023
1 parent 8507291 commit c6332bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/bluetooth/hci_ldisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
/* Disable hardware flow control */
ktermios = tty->termios;
ktermios.c_cflag &= ~CRTSCTS;
status = tty_set_termios(tty, &ktermios);
tty_set_termios(tty, &ktermios);
BT_DBG("Disabling hardware flow control: %s",
status ? "failed" : "success");
(tty->termios.c_cflag & CRTSCTS) ? "failed" : "success");

/* Clear RTS to prevent the device from sending */
/* Most UARTs need OUT2 to enable interrupts */
Expand Down Expand Up @@ -357,9 +357,9 @@ void hci_uart_set_flow_control(struct hci_uart *hu, bool enable)
/* Re-enable hardware flow control */
ktermios = tty->termios;
ktermios.c_cflag |= CRTSCTS;
status = tty_set_termios(tty, &ktermios);
tty_set_termios(tty, &ktermios);
BT_DBG("Enabling hardware flow control: %s",
status ? "failed" : "success");
!(tty->termios.c_cflag & CRTSCTS) ? "failed" : "success");
}
}

Expand Down

0 comments on commit c6332bb

Please sign in to comment.