On Sat, 24 Apr 2004 01:07:19 +0200 (CEST) Jan Capek <[EMAIL PROTECTED]> wrote:
> There it is, let me know what you think. This is what I wrote for 2.4.x > kernel, it should apply cleanly against the latest 2.4.27-pre1. OK at first glance, but one note: > static void ftdi_set_termios (struct usb_serial_port *port, struct termios > *old_termios) > { /* ftdi_termios */ > - /* FIXME -For this cut I don't care if the line is really changing or > - not - so just do the change regardless - should be able to > - compare old_termios and tty->termios */ > + /* Check if any change in termios settings occured*/ > + if (old_termios) { > + if ((cflag == old_termios->c_cflag) && > + (RELEVANT_IFLAG(port->tty->termios->c_iflag) == > + RELEVANT_IFLAG(old_termios->c_iflag))) { > + dbg("%s - nothing to change", __FUNCTION__); > + return; > + } > + old_baudrate = old_termios->c_cflag & CBAUD; > + } This is a suspect, because I hit an issue with such optimization in mct_u232 just recently. There was a certain path which fools the comparison _and_ the 2.4 and 2.6 do it differently (one starts card from an open and another doesn't). I'd need to have a closer look, because I do not remember details now. In general though, do not do such acrobatics in component drivers. Greg, do you agree? -- Pete ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel