X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fusb%2Fserial%2Fkl5kusb105.c;h=78335a5f77430e18a1d97e7b22e177f79ee07147;hb=43bc926fffd92024b46cafaf7350d669ba9ca884;hp=a11e829e38c8a04e8c90b1d3fa8f262176a4b41e;hpb=cee37fe97739d85991964371c1f3a745c00dd236;p=linux-2.6.git diff --git a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c index a11e829e3..78335a5f7 100644 --- a/drivers/usb/serial/kl5kusb105.c +++ b/drivers/usb/serial/kl5kusb105.c @@ -116,17 +116,19 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver kl5kusb105d_driver = { - .owner = THIS_MODULE, .name = "kl5kusb105d", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, + .no_dynamic_id = 1, }; -static struct usb_serial_device_type kl5kusb105d_device = { - .owner = THIS_MODULE, - .name = "KL5KUSB105D / PalmConnect", - .short_name = "kl5kusb105d", +static struct usb_serial_driver kl5kusb105d_device = { + .driver = { + .owner = THIS_MODULE, + .name = "kl5kusb105d", + }, + .description = "KL5KUSB105D / PalmConnect", .id_table = id_table, .num_interrupt_in = 1, .num_bulk_in = 1, @@ -646,7 +648,6 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs) usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data); } else { - int i; int bytes_sent = ((__u8 *) data)[0] + ((unsigned int) ((__u8 *) data)[1] << 8); tty = port->tty; @@ -667,16 +668,8 @@ static void klsi_105_read_bulk_callback (struct urb *urb, struct pt_regs *regs) bytes_sent = urb->actual_length - 2; } - for (i = 2; i < 2+bytes_sent; i++) { - /* if we insert more than TTY_FLIPBUF_SIZE characters, - * we drop them. */ - if(tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty_flip_buffer_push(tty); - } - /* this doesn't actually push the data through unless - * tty->low_latency is set */ - tty_insert_flip_char(tty, ((__u8*) data)[i], 0); - } + tty_buffer_request_room(tty, bytes_sent); + tty_insert_flip_string(tty, data + 2, bytes_sent); tty_flip_buffer_push(tty); /* again lockless, but debug info only */