Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 144042
b: refs/heads/master
c: 37768ad
h: refs/heads/master
v: v3
  • Loading branch information
Tony Cook authored and Greg Kroah-Hartman committed Apr 23, 2009
1 parent 597d070 commit 0bcce31
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9b8cffa923e8eb3fe70ea05d3fcfffc90a71a57
refs/heads/master: 37768adf9a1d49aeac0db1ba3dc28b3274b7b789
30 changes: 19 additions & 11 deletions trunk/drivers/usb/serial/mos7840.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/*
* Version Information
*/
#define DRIVER_VERSION "1.3.1"
#define DRIVER_VERSION "1.3.2"
#define DRIVER_DESC "Moschip 7840/7820 USB Serial Driver"

/*
Expand Down Expand Up @@ -2484,9 +2484,14 @@ static int mos7840_startup(struct usb_serial *serial)
mos7840_set_port_private(serial->port[i], mos7840_port);
spin_lock_init(&mos7840_port->pool_lock);

mos7840_port->port_num = ((serial->port[i]->number -
(serial->port[i]->serial->minor)) +
1);
/* minor is not initialised until later by
* usb-serial.c:get_free_serial() and cannot therefore be used
* to index device instances */
mos7840_port->port_num = i + 1;
dbg ("serial->port[i]->number = %d", serial->port[i]->number);
dbg ("serial->port[i]->serial->minor = %d", serial->port[i]->serial->minor);
dbg ("mos7840_port->port_num = %d", mos7840_port->port_num);
dbg ("serial->minor = %d", serial->minor);

if (mos7840_port->port_num == 1) {
mos7840_port->SpRegOffset = 0x0;
Expand Down Expand Up @@ -2697,13 +2702,16 @@ static void mos7840_shutdown(struct usb_serial *serial)

for (i = 0; i < serial->num_ports; ++i) {
mos7840_port = mos7840_get_port_private(serial->port[i]);
spin_lock_irqsave(&mos7840_port->pool_lock, flags);
mos7840_port->zombie = 1;
spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
usb_kill_urb(mos7840_port->control_urb);
kfree(mos7840_port->ctrl_buf);
kfree(mos7840_port->dr);
kfree(mos7840_port);
dbg ("mos7840_port %d = %p", i, mos7840_port);
if (mos7840_port) {
spin_lock_irqsave(&mos7840_port->pool_lock, flags);
mos7840_port->zombie = 1;
spin_unlock_irqrestore(&mos7840_port->pool_lock, flags);
usb_kill_urb(mos7840_port->control_urb);
kfree(mos7840_port->ctrl_buf);
kfree(mos7840_port->dr);
kfree(mos7840_port);
}
mos7840_set_port_private(serial->port[i], NULL);
}

Expand Down

0 comments on commit 0bcce31

Please sign in to comment.