git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
usb
/
serial
/
io_ti.c
diff --git
a/drivers/usb/serial/io_ti.c
b/drivers/usb/serial/io_ti.c
index
b9846a5
..
8e1e225
100644
(file)
--- 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 = {
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,
.name = "io_ti",
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = id_table_combined,
+ .no_dynamic_id = 1,
};
};
@@
-273,7
+273,7
@@
static int TIReadVendorRequestSync (struct usb_device *dev,
index,
data,
size,
index,
data,
size,
-
HZ
);
+
1000
);
if (status < 0)
return status;
if (status != size) {
if (status < 0)
return status;
if (status != size) {
@@
-303,8
+303,7
@@
static int TISendVendorRequestSync (struct usb_device *dev,
index,
data,
size,
index,
data,
size,
- HZ);
-
+ 1000);
if (status < 0)
return status;
if (status != size) {
if (status < 0)
return status;
if (status != size) {
@@
-985,7
+984,7
@@
static int TISendBulkTransferSync (struct usb_serial *serial, void *buffer, int
buffer,
length,
num_sent,
buffer,
length,
num_sent,
-
HZ
);
+
1000
);
return status;
}
return status;
}
@@
-1866,20
+1865,14
@@
static void edge_tty_recv(struct device *dev, struct tty_struct *tty, unsigned c
int cnt;
do {
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);
data += cnt;
length -= cnt;
} while (length > 0);
@@
-2734,12
+2727,11
@@
static int edge_startup (struct usb_serial *serial)
dev = serial->dev;
/* create our private serial structure */
dev = serial->dev;
/* create our private serial structure */
- edge_serial = k
malloc
(sizeof(struct edgeport_serial), GFP_KERNEL);
+ edge_serial = k
zalloc
(sizeof(struct edgeport_serial), GFP_KERNEL);
if (edge_serial == NULL) {
dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__);
return -ENOMEM;
}
if (edge_serial == NULL) {
dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__);
return -ENOMEM;
}
- memset (edge_serial, 0, sizeof(struct edgeport_serial));
sema_init(&edge_serial->es_sem, 1);
edge_serial->serial = serial;
usb_set_serial_data(serial, edge_serial);
sema_init(&edge_serial->es_sem, 1);
edge_serial->serial = serial;
usb_set_serial_data(serial, edge_serial);
@@
-2752,12
+2744,11
@@
static int edge_startup (struct usb_serial *serial)
/* set up our port private structures */
for (i = 0; i < serial->num_ports; ++i) {
/* set up our port private structures */
for (i = 0; i < serial->num_ports; ++i) {
- edge_port = k
malloc
(sizeof(struct edgeport_port), GFP_KERNEL);
+ edge_port = k
zalloc
(sizeof(struct edgeport_port), GFP_KERNEL);
if (edge_port == NULL) {
dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__);
goto cleanup;
}
if (edge_port == NULL) {
dev_err(&serial->dev->dev, "%s - Out of memory\n", __FUNCTION__);
goto cleanup;
}
- memset (edge_port, 0, sizeof(struct edgeport_port));
spin_lock_init(&edge_port->ep_lock);
edge_port->ep_out_buf = edge_buf_alloc(EDGE_OUT_BUF_SIZE);
if (edge_port->ep_out_buf == NULL) {
spin_lock_init(&edge_port->ep_lock);
edge_port->ep_out_buf = edge_buf_alloc(EDGE_OUT_BUF_SIZE);
if (edge_port->ep_out_buf == NULL) {
@@
-2844,11
+2835,10
@@
static struct edge_buf *edge_buf_alloc(unsigned int size)
* Free the buffer and all associated memory.
*/
* 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);
}
}
kfree(eb);
}
}
@@
-2984,10
+2974,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,
.id_table = edgeport_1port_id_table,
.num_interrupt_in = 1,
.num_bulk_in = 1,
@@
-3012,10
+3004,12
@@
static struct usb_serial_device_type edgeport_1port_device = {
.write_bulk_callback = edge_bulk_out_callback,
};
.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,
.id_table = edgeport_2port_id_table,
.num_interrupt_in = 1,
.num_bulk_in = 2,