Re: [PATCH] USB: spcp8x5: correct handling of CS5 setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Nov 08, 2013 at 10:53:11PM +0100, Colin Leitner wrote:
> 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@xxxxxxxxx>

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Johan Hovold <jhovold@xxxxxxxxx>

> ---
>  drivers/usb/serial/spcp8x5.c |   30 ++++++++++++++----------------
>  1 file changed, 14 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c
> index 4abac28..5b793c3 100644
> --- a/drivers/usb/serial/spcp8x5.c
> +++ b/drivers/usb/serial/spcp8x5.c
> @@ -348,22 +348,20 @@ static void spcp8x5_set_termios(struct tty_struct *tty,
>  	}
> 
>  	/* Set Data Length : 00:5bit, 01:6bit, 10:7bit, 11:8bit */
> -	if (cflag & CSIZE) {
> -		switch (cflag & CSIZE) {
> -		case CS5:
> -			buf[1] |= SET_UART_FORMAT_SIZE_5;
> -			break;
> -		case CS6:
> -			buf[1] |= SET_UART_FORMAT_SIZE_6;
> -			break;
> -		case CS7:
> -			buf[1] |= SET_UART_FORMAT_SIZE_7;
> -			break;
> -		default:
> -		case CS8:
> -			buf[1] |= SET_UART_FORMAT_SIZE_8;
> -			break;
> -		}
> +	switch (cflag & CSIZE) {
> +	case CS5:
> +		buf[1] |= SET_UART_FORMAT_SIZE_5;
> +		break;
> +	case CS6:
> +		buf[1] |= SET_UART_FORMAT_SIZE_6;
> +		break;
> +	case CS7:
> +		buf[1] |= SET_UART_FORMAT_SIZE_7;
> +		break;
> +	default:
> +	case CS8:
> +		buf[1] |= SET_UART_FORMAT_SIZE_8;
> +		break;
>  	}
> 
>  	/* Set Stop bit2 : 0:1bit 1:2bit */
> -- 
> 1.7.10.4
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux