Skip to content

Commit 711fbdf

Browse files
cleitnergregkh
authored andcommitted
USB: spcp8x5: correct handling of CS5 setting
This patch removes an erroneous check of CSIZE, which made it impossible to set CS5. Compiles clean, but couldn't test against hardware. Signed-off-by: Colin Leitner <colin.leitner@gmail.com> Signed-off-by: Johan Hovold <jhovold@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 471e42a commit 711fbdf

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

‎drivers/usb/serial/spcp8x5.c‎

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -348,22 +348,20 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
348348
}
349349

350350
/* Set Data Length : 00:5bit, 01:6bit, 10:7bit, 11:8bit */
351-
if (cflag & CSIZE) {
352-
switch (cflag & CSIZE) {
353-
case CS5:
354-
buf[1] |= SET_UART_FORMAT_SIZE_5;
355-
break;
356-
case CS6:
357-
buf[1] |= SET_UART_FORMAT_SIZE_6;
358-
break;
359-
case CS7:
360-
buf[1] |= SET_UART_FORMAT_SIZE_7;
361-
break;
362-
default:
363-
case CS8:
364-
buf[1] |= SET_UART_FORMAT_SIZE_8;
365-
break;
366-
}
351+
switch (cflag & CSIZE) {
352+
case CS5:
353+
buf[1] |= SET_UART_FORMAT_SIZE_5;
354+
break;
355+
case CS6:
356+
buf[1] |= SET_UART_FORMAT_SIZE_6;
357+
break;
358+
case CS7:
359+
buf[1] |= SET_UART_FORMAT_SIZE_7;
360+
break;
361+
default:
362+
case CS8:
363+
buf[1] |= SET_UART_FORMAT_SIZE_8;
364+
break;
367365
}
368366

369367
/* Set Stop bit2 : 0:1bit 1:2bit */

0 commit comments

Comments
 (0)