X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fusb%2Fserial%2Fio_ti.c;h=afc0f34b3a4695cc0ead14ad98368035d08da6a7;hb=749dfc70554f2c9e6624ac843d66571265ed9338;hp=6c96fdaec36e3a4de5007494073904b5116f7ff5;hpb=1da177e4c3f41524e886b7f1b8a0c1fc7321cac2;p=linux-2.6-omap-h63xx.git diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 6c96fdaec36..afc0f34b3a4 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -216,11 +216,11 @@ static struct usb_device_id id_table_combined [] = { MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_driver io_driver = { - .owner = THIS_MODULE, .name = "io_ti", .probe = usb_serial_probe, .disconnect = usb_serial_disconnect, .id_table = id_table_combined, + .no_dynamic_id = 1, }; @@ -1865,20 +1865,14 @@ static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned c int cnt; do { - if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - tty_flip_buffer_push(tty); - if (tty->flip.count >= TTY_FLIPBUF_SIZE) { - dev_err(dev, "%s - dropping data, %d bytes lost\n", - __FUNCTION__, length); - return; - } + cnt = tty_buffer_request_room(tty, length); + if (cnt < length) { + dev_err(dev, "%s - dropping data, %d bytes lost\n", + __FUNCTION__, length - cnt); + if(cnt == 0) + break; } - cnt = min(length, TTY_FLIPBUF_SIZE - tty->flip.count); - memcpy(tty->flip.char_buf_ptr, data, cnt); - memset(tty->flip.flag_buf_ptr, 0, cnt); - tty->flip.char_buf_ptr += cnt; - tty->flip.flag_buf_ptr += cnt; - tty->flip.count += cnt; + tty_insert_flip_string(tty, data, cnt); data += cnt; length -= cnt; } while (length > 0); @@ -2843,11 +2837,10 @@ static struct edge_buf *edge_buf_alloc(unsigned int size) * Free the buffer and all associated memory. */ -void edge_buf_free(struct edge_buf *eb) +static void edge_buf_free(struct edge_buf *eb) { - if (eb != NULL) { - if (eb->buf_buf != NULL) - kfree(eb->buf_buf); + if (eb) { + kfree(eb->buf_buf); kfree(eb); } } @@ -2983,10 +2976,12 @@ static unsigned int edge_buf_get(struct edge_buf *eb, char *buf, } -static struct usb_serial_device_type edgeport_1port_device = { - .owner = THIS_MODULE, - .name = "Edgeport TI 1 port adapter", - .short_name = "edgeport_ti_1", +static struct usb_serial_driver edgeport_1port_device = { + .driver = { + .owner = THIS_MODULE, + .name = "edgeport_ti_1", + }, + .description = "Edgeport TI 1 port adapter", .id_table = edgeport_1port_id_table, .num_interrupt_in = 1, .num_bulk_in = 1, @@ -3011,10 +3006,12 @@ static struct usb_serial_device_type edgeport_1port_device = { .write_bulk_callback = edge_bulk_out_callback, }; -static struct usb_serial_device_type edgeport_2port_device = { - .owner = THIS_MODULE, - .name = "Edgeport TI 2 port adapter", - .short_name = "edgeport_ti_2", +static struct usb_serial_driver edgeport_2port_device = { + .driver = { + .owner = THIS_MODULE, + .name = "edgeport_ti_2", + }, + .description = "Edgeport TI 2 port adapter", .id_table = edgeport_2port_id_table, .num_interrupt_in = 1, .num_bulk_in = 2,