On Fri, Apr 23, 2004 at 04:30:08PM -0700, Pete Zaitcev wrote:
> On Sat, 24 Apr 2004 01:07:19 +0200 (CEST) Jan Capek <[EMAIL PROTECTED]> wrote:
> >  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?

Hm, if you do want to check stuff like that, make sure your logic is
correct :)

But yes, it's probably just best to set the line setting again, and not
worry about old_termios most of the time.  That reduces complexity and
potential bugs.

thanks,

greg k-h


-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to 
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to