Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f21ec3d2 authored by Huang Shijie's avatar Huang Shijie Committed by Greg Kroah-Hartman
Browse files

serial: add a new helper function



In most of the time, the driver needs to check if the cts flow control
is enabled. But now, the driver checks the ASYNC_CTS_FLOW flag manually,
which is not a grace way. So add a new wraper function to make the code
tidy and clean.

Signed-off-by: default avatarHuang Shijie <shijie8@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e5b57c03
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1050,7 +1050,7 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty)
	wake_up_interruptible(&info->status_event_wait_q);
	wake_up_interruptible(&info->event_wait_q);

	if (info->port.flags & ASYNC_CTS_FLOW) {
	if (tty_port_cts_enabled(&info->port)) {
		if (tty->hw_stopped) {
			if (info->serial_signals & SerialSignal_CTS) {
				if (debug_level >= DEBUG_LEVEL_ISR)
+1 −1
Original line number Diff line number Diff line
@@ -420,7 +420,7 @@ static void check_modem_status(struct serial_state *info)
				tty_hangup(port->tty);
		}
	}
	if (port->flags & ASYNC_CTS_FLOW) {
	if (tty_port_cts_enabled(port)) {
		if (port->tty->hw_stopped) {
			if (!(status & SER_CTS)) {
#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
+1 −1
Original line number Diff line number Diff line
@@ -727,7 +727,7 @@ static void cyy_chip_modem(struct cyclades_card *cinfo, int chip,
		else
			tty_hangup(tty);
	}
	if ((mdm_change & CyCTS) && (info->port.flags & ASYNC_CTS_FLOW)) {
	if ((mdm_change & CyCTS) && tty_port_cts_enabled(&info->port)) {
		if (tty->hw_stopped) {
			if (mdm_status & CyCTS) {
				/* cy_start isn't used
+1 −1
Original line number Diff line number Diff line
@@ -600,7 +600,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
					port->status &= ~ISI_DCD;
			}

			if (port->port.flags & ASYNC_CTS_FLOW) {
			if (tty_port_cts_enabled(&port->port)) {
				if (tty->hw_stopped) {
					if (header & ISI_CTS) {
						port->port.tty->hw_stopped = 0;
+1 −1
Original line number Diff line number Diff line
@@ -830,7 +830,7 @@ static void mxser_check_modem_status(struct tty_struct *tty,
			wake_up_interruptible(&port->port.open_wait);
	}

	if (port->port.flags & ASYNC_CTS_FLOW) {
	if (tty_port_cts_enabled(&port->port)) {
		if (tty->hw_stopped) {
			if (status & UART_MSR_CTS) {
				tty->hw_stopped = 0;
Loading