Re: [PATCH] serial: The new version of the driver MAX3107.
From: Alan Cox <hidden>
Date: 2012-07-27 15:12:05
From: Alan Cox <hidden>
Date: 2012-07-27 15:12:05
+static void max3107_handle_rx(struct max3107_port *s, unsigned int
rxlen) +{
+ unsigned int status, ch, flag;
+ struct tty_struct *tty = s->port.state->port.tty;This all wants to be using tty_port_tty_get() and tty_kref_put - thats a problem from the original of course. tty could also be NULL.
+ tty = port->state->port.tty; + if (!tty) + return;
This seems to be a meaninless test ?
+ + /* Word size */ + if ((termios->c_cflag & CSIZE) == CS7) + lcr = MAX3107_LCR_WORD_LEN_7; + else + lcr = MAX3107_LCR_WORD_LEN_8;
Should also write back the word size actually used if we can't see that which was requested (ie mask ~CSIZE and | CS8 in the CS5/6 case)
+static volatile int driver_registered = 0;
Shouldn't need a volatile. Module load/unload are serialized for obvious reasons. Looks a very improved driver. Alan