All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Bryan Wu <cooloney@kernel.org>
Cc: linux-kernel@vger.kernel.org, Oleksiy Kebkal <kebkal@gmail.com>,
	Oleksiy Kebkal <lesha@evologics.de>,
	Russell King <rmk@arm.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Bryan Wu <cooloney@kernel.org>
Subject: Re: [PATCH 1/1] [serial/core]: This patch leaves RTS alone when CRTSCTS is not set.
Date: Mon, 12 May 2008 11:44:07 +0100	[thread overview]
Message-ID: <20080512114407.1dd79301@core> (raw)
In-Reply-To: <1210587614-10016-1-git-send-email-cooloney@kernel.org>

> +			 * Setup the RTS (in the case of hardware flow control)
> +			 * and DTR signals once the port is open and ready to
> +			 * respond.
>  			 */
> -			if (info->tty->termios->c_cflag & CBAUD)
> -				uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR);
> +			if (info->tty->termios->c_cflag & CBAUD) {
> +				uart_set_mctrl(port, TIOCM_DTR);
> +				if (info->flags & UIF_CTS_FLOW)
> +					uart_set_mctrl(port, TIOCM_RTS);
> +			}

Seems fine but we've now got 5 line blocks of duplicated code - and code
we will need to complicate further in future if we add other flow control
systems.

statc void uart_set_flow_control(port, int onoff)
{
	..
}

Would be worth writing and using for these cases

(Yes I am being fussy: I am currently trying to stamp out lots of code
duplication in the tty and serial layers so I don't want more added as it
is getting out of hand)

Alan

  reply	other threads:[~2008-05-12 10:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-12 10:20 [PATCH 1/1] [serial/core]: This patch leaves RTS alone when CRTSCTS is not set Bryan Wu
2008-05-12 10:44 ` Alan Cox [this message]
2008-05-12 11:18 ` Russell King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080512114407.1dd79301@core \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=cooloney@kernel.org \
    --cc=kebkal@gmail.com \
    --cc=lesha@evologics.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.