Commit 560aac22e1dce7c7e9756a0a4450ca3bae58fcd5
Committed by
Greg Kroah-Hartman
1 parent
998e863871
Exists in
master
and in
7 other branches
USB: ir_usb: termios handling
- Clean up paranoia checks - Propogate back a correct fixed termios Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 4 additions and 7 deletions Side-by-side Diff
drivers/usb/serial/ir-usb.c
... | ... | @@ -504,11 +504,6 @@ |
504 | 504 | |
505 | 505 | dbg("%s - port %d", __FUNCTION__, port->number); |
506 | 506 | |
507 | - if ((!port->tty) || (!port->tty->termios)) { | |
508 | - dbg("%s - no tty structures", __FUNCTION__); | |
509 | - return; | |
510 | - } | |
511 | - | |
512 | 507 | baud = tty_get_baud_rate(port->tty); |
513 | 508 | |
514 | 509 | /* |
... | ... | @@ -531,8 +526,6 @@ |
531 | 526 | default: |
532 | 527 | ir_baud = SPEED_9600; |
533 | 528 | baud = 9600; |
534 | - /* And once the new tty stuff is all done we need to | |
535 | - call back to correct the baud bits */ | |
536 | 529 | } |
537 | 530 | |
538 | 531 | if (xbof == -1) |
... | ... | @@ -562,6 +555,10 @@ |
562 | 555 | result = usb_submit_urb (port->write_urb, GFP_KERNEL); |
563 | 556 | if (result) |
564 | 557 | dev_err(&port->dev, "%s - failed submitting write urb, error %d\n", __FUNCTION__, result); |
558 | + | |
559 | + /* Only speed changes are supported */ | |
560 | + tty_termios_copy_hw(port->tty->termios, old_termios); | |
561 | + tty_encode_baud_rate(port->tty, baud, baud); | |
565 | 562 | } |
566 | 563 | |
567 | 564 |