diff options
Diffstat (limited to 'drivers/usb/serial/empeg.c')
-rw-r--r-- | drivers/usb/serial/empeg.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index 050fcc996f56..a5c8e1e17ea5 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c | |||
@@ -449,14 +449,9 @@ static int empeg_ioctl (struct usb_serial_port *port, struct file * file, unsign | |||
449 | 449 | ||
450 | static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *old_termios) | 450 | static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *old_termios) |
451 | { | 451 | { |
452 | 452 | struct ktermios *termios = port->tty->termios; | |
453 | dbg("%s - port %d", __FUNCTION__, port->number); | 453 | dbg("%s - port %d", __FUNCTION__, port->number); |
454 | 454 | ||
455 | if ((!port->tty) || (!port->tty->termios)) { | ||
456 | dbg("%s - no tty structures", __FUNCTION__); | ||
457 | return; | ||
458 | } | ||
459 | |||
460 | /* | 455 | /* |
461 | * The empeg-car player wants these particular tty settings. | 456 | * The empeg-car player wants these particular tty settings. |
462 | * You could, for example, change the baud rate, however the | 457 | * You could, for example, change the baud rate, however the |
@@ -466,7 +461,7 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol | |||
466 | * | 461 | * |
467 | * The default requirements for this device are: | 462 | * The default requirements for this device are: |
468 | */ | 463 | */ |
469 | port->tty->termios->c_iflag | 464 | termios->c_iflag |
470 | &= ~(IGNBRK /* disable ignore break */ | 465 | &= ~(IGNBRK /* disable ignore break */ |
471 | | BRKINT /* disable break causes interrupt */ | 466 | | BRKINT /* disable break causes interrupt */ |
472 | | PARMRK /* disable mark parity errors */ | 467 | | PARMRK /* disable mark parity errors */ |
@@ -476,24 +471,23 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol | |||
476 | | ICRNL /* disable translate CR to NL */ | 471 | | ICRNL /* disable translate CR to NL */ |
477 | | IXON); /* disable enable XON/XOFF flow control */ | 472 | | IXON); /* disable enable XON/XOFF flow control */ |
478 | 473 | ||
479 | port->tty->termios->c_oflag | 474 | termios->c_oflag |
480 | &= ~OPOST; /* disable postprocess output characters */ | 475 | &= ~OPOST; /* disable postprocess output characters */ |
481 | 476 | ||
482 | port->tty->termios->c_lflag | 477 | termios->c_lflag |
483 | &= ~(ECHO /* disable echo input characters */ | 478 | &= ~(ECHO /* disable echo input characters */ |
484 | | ECHONL /* disable echo new line */ | 479 | | ECHONL /* disable echo new line */ |
485 | | ICANON /* disable erase, kill, werase, and rprnt special characters */ | 480 | | ICANON /* disable erase, kill, werase, and rprnt special characters */ |
486 | | ISIG /* disable interrupt, quit, and suspend special characters */ | 481 | | ISIG /* disable interrupt, quit, and suspend special characters */ |
487 | | IEXTEN); /* disable non-POSIX special characters */ | 482 | | IEXTEN); /* disable non-POSIX special characters */ |
488 | 483 | ||
489 | port->tty->termios->c_cflag | 484 | termios->c_cflag |
490 | &= ~(CSIZE /* no size */ | 485 | &= ~(CSIZE /* no size */ |
491 | | PARENB /* disable parity bit */ | 486 | | PARENB /* disable parity bit */ |
492 | | CBAUD); /* clear current baud rate */ | 487 | | CBAUD); /* clear current baud rate */ |
493 | 488 | ||
494 | port->tty->termios->c_cflag | 489 | termios->c_cflag |
495 | |= (CS8 /* character size 8 bits */ | 490 | |= CS8; /* character size 8 bits */ |
496 | | B115200); /* baud rate 115200 */ | ||
497 | 491 | ||
498 | /* | 492 | /* |
499 | * Force low_latency on; otherwise the pushes are scheduled; | 493 | * Force low_latency on; otherwise the pushes are scheduled; |
@@ -501,8 +495,7 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol | |||
501 | * on the floor. We don't want to drop bytes on the floor. :) | 495 | * on the floor. We don't want to drop bytes on the floor. :) |
502 | */ | 496 | */ |
503 | port->tty->low_latency = 1; | 497 | port->tty->low_latency = 1; |
504 | 498 | tty_encode_baud_rate(port->tty, 115200, 115200); | |
505 | return; | ||
506 | } | 499 | } |
507 | 500 | ||
508 | 501 | ||