From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Hovold Subject: Re: [PATCH] pl2303: fixed handling of CS5 setting. 5 databits work now Date: Sun, 3 Nov 2013 18:04:23 +0100 Message-ID: <20131103170423.GC32672@localhost> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mail-la0-f48.google.com ([209.85.215.48]:55373 "EHLO mail-la0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752149Ab3KCREa (ORCPT ); Sun, 3 Nov 2013 12:04:30 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-serial-owner@vger.kernel.org List-Id: linux-serial@vger.kernel.org To: Colin Leitner Cc: gregkh@linuxfoundation.org, linux-serial@vger.kernel.org, linux-usb@vger.kernel.org [ Please make sure to CC the linux-usb list. ] On Sun, Nov 03, 2013 at 03:47:06PM +0100, Colin Leitner wrote: > pl2303: fixed handling of CS5 setting. 5 databits work now No need to repeat the subject line in the body, and please add a "USB:"-prefix and drop the "5 databits work now" from the subject. > This patch fixes the CS5 setting on the PL2303 USB-to-serial devices. CS5 has > a value of 0 and the CSIZE setting has been skipped altogether by the enclosing > if. Tested on 3.11.6 and the scope shows the correct output after the fix has > been applied. Good catch! Unfortunately, the patch is white-space damaged. You should use tabs for indentation. Please run your patches through checkpatch.pl before submitting (or fix your mail client if that's where the problem is). > Tagged to be added to stable, because it fixes a user visible driver bug and is > simple enough to backport easily. > > Cc: stable@vger.kernel.org > Signed-off-by: Colin Leitner > --- > drivers/usb/serial/pl2303.c | 30 ++++++++++++++---------------- > 1 file changed, 14 insertions(+), 16 deletions(-) > > diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c > index bedf8e4..fd86357 100644 > --- a/drivers/usb/serial/pl2303.c > +++ b/drivers/usb/serial/pl2303.c > @@ -522,23 +522,21 @@ static void pl2303_set_termios(struct tty_struct *tty, > 0, 0, buf, 7, 100); > dev_dbg(&port->dev, "0xa1:0x21:0:0 %d - %7ph\n", i, buf); > > - if (C_CSIZE(tty)) { > - switch (C_CSIZE(tty)) { > - case CS5: > - buf[6] = 5; > - break; > - case CS6: > - buf[6] = 6; > - break; > - case CS7: > - buf[6] = 7; > - break; > - default: > - case CS8: > - buf[6] = 8; > - } > - dev_dbg(&port->dev, "data bits = %d\n", buf[6]); > + switch (C_CSIZE(tty)) { > + case CS5: > + buf[6] = 5; > + break; > + case CS6: > + buf[6] = 6; > + break; > + case CS7: > + buf[6] = 7; > + break; > + default: You can drop the default-case as CSIZE is a two-bit mask. Care to respin? Thanks, Johan > + case CS8: > + buf[6] = 8; > } > + dev_dbg(&port->dev, "data bits = %d\n", buf[6]); > > /* For reference: buf[0]:buf[3] baud rate value */ > pl2303_encode_baudrate(tty, port, spriv->type, buf); > -- > 1.7.10.4 > -- > To unsubscribe from this list: send the line "unsubscribe linux-serial" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html