[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080512114407.1dd79301@core>
Date:	Mon, 12 May 2008 11:44:07 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Bryan Wu <cooloney@...nel.org>
Cc:	linux-kernel@...r.kernel.org, Oleksiy Kebkal <kebkal@...il.com>,
	Oleksiy Kebkal <lesha@...logics.de>,
	Russell King <rmk@....linux.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Bryan Wu <cooloney@...nel.org>
Subject: Re: [PATCH 1/1] [serial/core]: This patch leaves RTS alone when
 CRTSCTS is not set.
> +			 * 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
