Skip to contentSkip to conversation

USB: serial: spcp8x5: simplify init_termios

PATCH In review Johan Hovold 1 participant 1 message Apr 21, 2019

Subsystems (2)
lore
Share & tools
lore

Johan Hovold

author maintainer
#0 lore raw

PATCH 9/9 USB: serial: spcp8x5: simplify init_termios

Simplify init_termios which is only used to override the initial baudrate.

---
 drivers/usb/serial/spcp8x5.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/usb/serial/spcp8x5.c +1 -4
index b42714855364..3bac55bd9bd9 100644
@@ -281,10 +281,7 @@ static void spcp8x5_dtr_rts(struct usb_serial_port *port, int on)
 
 static void spcp8x5_init_termios(struct tty_struct *tty)
 {
-	tty->termios = tty_std_termios;
-	tty->termios.c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL;
-	tty->termios.c_ispeed = 115200;
-	tty->termios.c_ospeed = 115200;
+	tty_encode_baud_rate(tty, 115200, 115200);
 }
 
 static void spcp8x5_set_termios(struct tty_struct *tty,