lkml.org 
[lkml]   [2008]   [May]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-05-12 12:57    [W:0.028 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site