X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fusb%2Fserial%2Fempeg.c;h=63f7c78a1152d05924711628be6c2e93b70ef555;hb=cc169158e75d370ff961e5653a326a7ee1688b6b;hp=8d562ab454a8589335d1d6350b80bfe6b32b0c80;hpb=207e0a826fdee4bfe853681aef2175a739c11286;p=linux-2.6.git diff --git a/drivers/usb/serial/empeg.c b/drivers/usb/serial/empeg.c index 8d562ab45..63f7c78a1 100644 --- a/drivers/usb/serial/empeg.c +++ b/drivers/usb/serial/empeg.c @@ -105,16 +105,18 @@ static struct usb_device_id id_table [] = { MODULE_DEVICE_TABLE (usb, id_table); static struct usb_driver empeg_driver = { - .owner = THIS_MODULE, .name = "empeg", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table, + .no_dynamic_id = 1, }; -static struct usb_serial_device_type empeg_device = { - .owner = THIS_MODULE, - .name = "Empeg", +static struct usb_serial_driver empeg_device = { + .driver = { + .owner = THIS_MODULE, + .name = "empeg", + }, .id_table = id_table, .num_interrupt_in = 0, .num_bulk_in = 1, @@ -342,7 +344,6 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs) struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct tty_struct *tty; unsigned char *data = urb->transfer_buffer; - int i; int result; dbg("%s - port %d", __FUNCTION__, port->number); @@ -357,19 +358,8 @@ static void empeg_read_bulk_callback (struct urb *urb, struct pt_regs *regs) tty = port->tty; if (urb->actual_length) { - for (i = 0; i < urb->actual_length ; ++i) { - /* gb - 2000/11/13 - * If we insert too many characters we'll overflow the buffer. - * This means we'll lose bytes - Decidedly bad. - */ - if(tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty_flip_buffer_push(tty); - } - tty_insert_flip_char(tty, data[i], 0); - } - /* gb - 2000/11/13 - * Goes straight through instead of scheduling - if tty->low_latency is set. - */ + tty_buffer_request_room(tty, urb->actual_length); + tty_insert_flip_string(tty, data, urb->actual_length); tty_flip_buffer_push(tty); bytes_in += urb->actual_length; }