@@ -119,7 +119,6 @@ struct switchtec_uart{
119119#define UART_MAX_READ_BYTES 1024
120120#define RETRY_NUM 3
121121#define SWITCHTEC_UART_BAUDRATE (B230400)
122- #define SWITCHTEC_UART_STOP_BITS (2)
123122
124123static int send_cmd (int fd , const char * fmt , int write_bytes , ...)
125124{
@@ -462,7 +461,7 @@ static const struct switchtec_ops uart_ops = {
462461 .write_from_gas = uart_write_from_gas ,
463462};
464463
465- static int set_uart_attribs (int fd , int speed , int parity , int stop_bits )
464+ static int set_uart_attribs (int fd , int speed , int parity )
466465{
467466 int ret ;
468467 struct termios uart_attribs ;
@@ -483,10 +482,7 @@ static int set_uart_attribs(int fd, int speed, int parity, int stop_bits)
483482 uart_attribs .c_cflag |= (CLOCAL | CREAD );
484483 uart_attribs .c_cflag &= ~(PARENB | PARODD );
485484 uart_attribs .c_cflag |= parity ;
486- if (stop_bits == 1 )
487- uart_attribs .c_cflag &= ~CSTOPB ;
488- else if (stop_bits == 2 )
489- uart_attribs .c_cflag |= CSTOPB ;
485+ uart_attribs .c_cflag &= ~CSTOPB ;
490486 uart_attribs .c_cflag &= ~CRTSCTS ;
491487 uart_attribs .c_cc [VMIN ] = 0 ;
492488 uart_attribs .c_cc [VTIME ] = 50 ;
@@ -515,7 +511,7 @@ struct switchtec_dev *switchtec_open_uart(int fd)
515511 if (ret )
516512 goto err_close_free ;
517513
518- ret = set_uart_attribs (udev -> fd , SWITCHTEC_UART_BAUDRATE , 0 , SWITCHTEC_UART_STOP_BITS );
514+ ret = set_uart_attribs (udev -> fd , SWITCHTEC_UART_BAUDRATE , 0 );
519515 if (ret )
520516 goto err_close_free ;
521517
0 commit comments