diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-03 11:48:58 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-03 11:48:58 -0500 |
commit | 7f5b09c15ab989ed5ce4adda0be42c1302df70b7 (patch) | |
tree | 9695b00983d1bd077ff91c463abcb136330cf344 /drivers/usb/serial/kobil_sct.c | |
parent | 94468080220162f74dc6ce5c3e95e5fec8022902 (diff) | |
parent | cedf8a78421943441b9011ce7bcdab55f07d2ea6 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (220 commits)
USB: backlight, appledisplay: fix incomplete registration failure handling
USB: pl2303: remove unnecessary reset of usb_device in urbs
USB: ftdi_sio: remove obsolete check in unthrottle
USB: ftdi_sio: remove unused tx_bytes counter
USB: qcaux: driver for auxiliary serial ports on Qualcomm devices
USB: pl2303: initial TIOCGSERIAL support
USB: option: add Longcheer/Longsung vendor ID
USB: fix I2C API usage in ohci-pnx4008.
USB: usbmon: mask seconds properly in text API
USB: sisusbvga: no unnecessary GFP_ATOMIC
USB: storage: onetouch: unnecessary GFP_ATOMIC
USB: serial: ftdi: add CONTEC vendor and product id
USB: remove references to port->port.count from the serial drivers
USB: tty: Prune uses of tty_request_room in the USB layer
USB: tty: Add a function to insert a string of characters with the same flag
USB: don't read past config->interface[] if usb_control_msg() fails in usb_reset_configuration()
USB: tty: kill request_room for USB ACM class
USB: tty: sort out the request_room handling for whiteheat
USB: storage: fix misplaced parenthesis
USB: vstusb.c: removal of driver for Vernier Software & Technology, Inc., devices and spectrometers
...
Diffstat (limited to 'drivers/usb/serial/kobil_sct.c')
-rw-r--r-- | drivers/usb/serial/kobil_sct.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/usb/serial/kobil_sct.c b/drivers/usb/serial/kobil_sct.c index 45ea694b3ae6..c113a2a0e10c 100644 --- a/drivers/usb/serial/kobil_sct.c +++ b/drivers/usb/serial/kobil_sct.c | |||
@@ -86,7 +86,7 @@ static void kobil_set_termios(struct tty_struct *tty, | |||
86 | struct usb_serial_port *port, struct ktermios *old); | 86 | struct usb_serial_port *port, struct ktermios *old); |
87 | static void kobil_init_termios(struct tty_struct *tty); | 87 | static void kobil_init_termios(struct tty_struct *tty); |
88 | 88 | ||
89 | static struct usb_device_id id_table [] = { | 89 | static const struct usb_device_id id_table[] = { |
90 | { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_B_PRODUCT_ID) }, | 90 | { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_B_PRODUCT_ID) }, |
91 | { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_K_PRODUCT_ID) }, | 91 | { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_ADAPTER_K_PRODUCT_ID) }, |
92 | { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_USBTWIN_PRODUCT_ID) }, | 92 | { USB_DEVICE(KOBIL_VENDOR_ID, KOBIL_USBTWIN_PRODUCT_ID) }, |
@@ -388,7 +388,6 @@ static void kobil_read_int_callback(struct urb *urb) | |||
388 | */ | 388 | */ |
389 | /* END DEBUG */ | 389 | /* END DEBUG */ |
390 | 390 | ||
391 | tty_buffer_request_room(tty, urb->actual_length); | ||
392 | tty_insert_flip_string(tty, data, urb->actual_length); | 391 | tty_insert_flip_string(tty, data, urb->actual_length); |
393 | tty_flip_buffer_push(tty); | 392 | tty_flip_buffer_push(tty); |
394 | } | 393 | } |
@@ -624,7 +623,6 @@ static void kobil_set_termios(struct tty_struct *tty, | |||
624 | unsigned short urb_val = 0; | 623 | unsigned short urb_val = 0; |
625 | int c_cflag = tty->termios->c_cflag; | 624 | int c_cflag = tty->termios->c_cflag; |
626 | speed_t speed; | 625 | speed_t speed; |
627 | void *settings; | ||
628 | 626 | ||
629 | priv = usb_get_serial_port_data(port); | 627 | priv = usb_get_serial_port_data(port); |
630 | if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID || | 628 | if (priv->device_type == KOBIL_USBTWIN_PRODUCT_ID || |
@@ -647,25 +645,13 @@ static void kobil_set_termios(struct tty_struct *tty, | |||
647 | } | 645 | } |
648 | urb_val |= (c_cflag & CSTOPB) ? SUSBCR_SPASB_2StopBits : | 646 | urb_val |= (c_cflag & CSTOPB) ? SUSBCR_SPASB_2StopBits : |
649 | SUSBCR_SPASB_1StopBit; | 647 | SUSBCR_SPASB_1StopBit; |
650 | |||
651 | settings = kzalloc(50, GFP_KERNEL); | ||
652 | if (!settings) | ||
653 | return; | ||
654 | |||
655 | sprintf(settings, "%d ", speed); | ||
656 | |||
657 | if (c_cflag & PARENB) { | 648 | if (c_cflag & PARENB) { |
658 | if (c_cflag & PARODD) { | 649 | if (c_cflag & PARODD) |
659 | urb_val |= SUSBCR_SPASB_OddParity; | 650 | urb_val |= SUSBCR_SPASB_OddParity; |
660 | strcat(settings, "Odd Parity"); | 651 | else |
661 | } else { | ||
662 | urb_val |= SUSBCR_SPASB_EvenParity; | 652 | urb_val |= SUSBCR_SPASB_EvenParity; |
663 | strcat(settings, "Even Parity"); | 653 | } else |
664 | } | ||
665 | } else { | ||
666 | urb_val |= SUSBCR_SPASB_NoParity; | 654 | urb_val |= SUSBCR_SPASB_NoParity; |
667 | strcat(settings, "No Parity"); | ||
668 | } | ||
669 | tty->termios->c_cflag &= ~CMSPAR; | 655 | tty->termios->c_cflag &= ~CMSPAR; |
670 | tty_encode_baud_rate(tty, speed, speed); | 656 | tty_encode_baud_rate(tty, speed, speed); |
671 | 657 | ||
@@ -675,11 +661,10 @@ static void kobil_set_termios(struct tty_struct *tty, | |||
675 | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, | 661 | USB_TYPE_VENDOR | USB_RECIP_ENDPOINT | USB_DIR_OUT, |
676 | urb_val, | 662 | urb_val, |
677 | 0, | 663 | 0, |
678 | settings, | 664 | NULL, |
679 | 0, | 665 | 0, |
680 | KOBIL_TIMEOUT | 666 | KOBIL_TIMEOUT |
681 | ); | 667 | ); |
682 | kfree(settings); | ||
683 | } | 668 | } |
684 | 669 | ||
685 | static int kobil_ioctl(struct tty_struct *tty, struct file *file, | 670 | static int kobil_ioctl(struct tty_struct *tty, struct file *file, |