ChangeSet 1.1415, 2003/09/03 11:44:49-07:00, greg@kroah.com [PATCH] USB: fix up B0 support in the pl2303 driver. Thanks to Gernot Fink for pointing this out. drivers/usb/serial/pl2303.c | 21 ++++++++++++--------- 1 files changed, 12 insertions(+), 9 deletions(-) diff -Nru a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c --- a/drivers/usb/serial/pl2303.c Fri Sep 5 17:59:32 2003 +++ b/drivers/usb/serial/pl2303.c Fri Sep 5 17:59:32 2003 @@ -245,6 +245,7 @@ unsigned char *buf; int baud; int i; + u8 control; dbg("%s - port %d", __FUNCTION__, port->number); @@ -360,17 +361,19 @@ 0, 0, buf, 7, 100); dbg ("0x21:0x20:0:0 %d", i); - if (cflag && CBAUD) { - u8 control; - - spin_lock_irqsave(&priv->lock, flags); - if ((cflag && CBAUD) == B0) - priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); - else - priv->line_control |= (CONTROL_DTR | CONTROL_RTS); + /* change control lines if we are switching to or from B0 */ + spin_lock_irqsave(&priv->lock, flags); + control = priv->line_control; + if ((cflag & CBAUD) == B0) + priv->line_control &= ~(CONTROL_DTR | CONTROL_RTS); + else + priv->line_control |= (CONTROL_DTR | CONTROL_RTS); + if (control != priv->line_control) { control = priv->line_control; spin_unlock_irqrestore(&priv->lock, flags); - set_control_lines (serial->dev, control); + set_control_lines(serial->dev, control); + } else { + spin_unlock_irqrestore(&priv->lock, flags); } buf[0] = buf[1] = buf[2] = buf[3] = buf[4] = buf[5] = buf[6] = 0;