diff options
author | Alan Cox <alan@linux.intel.com> | 2009-06-22 13:42:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-22 14:32:24 -0400 |
commit | 94362fd7fbad653c9517efa4aa7cd8fdadd527b1 (patch) | |
tree | 692b587977908bc2c92a10268333cd5f264f610c /drivers | |
parent | a6540f731d506d9e82444cf0020e716613d4c46c (diff) |
tty: fix some bogns in the serqt_usb2 driver
Remove the replicated urban legends from the comments and fix a couple of
other silly calls
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/serqt_usb2/serqt_usb2.c | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c index 581232b719fd..90b29b564631 100644 --- a/drivers/staging/serqt_usb2/serqt_usb2.c +++ b/drivers/staging/serqt_usb2/serqt_usb2.c | |||
@@ -284,21 +284,12 @@ static void ProcessModemStatus(struct quatech_port *qt_port, | |||
284 | return; | 284 | return; |
285 | } | 285 | } |
286 | 286 | ||
287 | static void ProcessRxChar(struct usb_serial_port *port, unsigned char Data) | 287 | static void ProcessRxChar(struct tty_struct *tty, struct usb_serial_port *port, |
288 | unsigned char data) | ||
288 | { | 289 | { |
289 | struct tty_struct *tty; | ||
290 | struct urb *urb = port->read_urb; | 290 | struct urb *urb = port->read_urb; |
291 | tty = tty_port_tty_get(&port->port); | 291 | if (urb->actual_length) |
292 | 292 | tty_insert_flip_char(tty, data, TTY_NORMAL); | |
293 | /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */ | ||
294 | |||
295 | if (tty && urb->actual_length) { | ||
296 | tty_buffer_request_room(tty, 1); | ||
297 | tty_insert_flip_string(tty, &Data, 1); | ||
298 | /* tty_flip_buffer_push(tty); */ | ||
299 | } | ||
300 | |||
301 | return; | ||
302 | } | 293 | } |
303 | 294 | ||
304 | static void qt_write_bulk_callback(struct urb *urb) | 295 | static void qt_write_bulk_callback(struct urb *urb) |
@@ -435,8 +426,10 @@ static void qt_read_bulk_callback(struct urb *urb) | |||
435 | case 0xff: | 426 | case 0xff: |
436 | dbg("No status sequence. \n"); | 427 | dbg("No status sequence. \n"); |
437 | 428 | ||
438 | ProcessRxChar(port, data[i]); | 429 | if (tty) { |
439 | ProcessRxChar(port, data[i + 1]); | 430 | ProcessRxChar(tty, port, data[i]); |
431 | ProcessRxChar(tty, port, data[i + 1]); | ||
432 | } | ||
440 | i += 2; | 433 | i += 2; |
441 | break; | 434 | break; |
442 | } | 435 | } |
@@ -444,10 +437,8 @@ static void qt_read_bulk_callback(struct urb *urb) | |||
444 | continue; | 437 | continue; |
445 | } | 438 | } |
446 | 439 | ||
447 | if (tty && urb->actual_length) { | 440 | if (tty && urb->actual_length) |
448 | tty_buffer_request_room(tty, 1); | 441 | tty_insert_flip_char(tty, data[i], TTY_NORMAL); |
449 | tty_insert_flip_string(tty, (data + i), 1); | ||
450 | } | ||
451 | 442 | ||
452 | } | 443 | } |
453 | tty_flip_buffer_push(tty); | 444 | tty_flip_buffer_push(tty); |