Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 354424
b: refs/heads/master
c: 9377b92
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Feb 6, 2013
1 parent 5f31503 commit a95af55
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 30 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: 07b502f50bfc290222fe4032501619a44bbd777e
refs/heads/master: 9377b9234f159773a53c7277559cc24397dd9803
49 changes: 20 additions & 29 deletions trunk/drivers/staging/comedi/drivers/vmk80xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1214,12 +1214,26 @@ static void vmk80xx_detach(struct comedi_device *dev)
{
struct vmk80xx_usb *usb = dev->private;

if (usb) {
down(&usb->limit_sem);
dev->private = NULL;
usb->attached = 0;
up(&usb->limit_sem);
}
if (!usb)
return;

mutex_lock(&glb_mutex);
down(&usb->limit_sem);

dev->private = NULL;

usb->attached = 0;
usb->probed = 0;
usb_set_intfdata(usb->intf, NULL);

usb_kill_anchored_urbs(&usb->rx_anchor);
usb_kill_anchored_urbs(&usb->tx_anchor);

kfree(usb->usb_rx_buf);
kfree(usb->usb_tx_buf);

up(&usb->limit_sem);
mutex_unlock(&glb_mutex);
}

static struct comedi_driver vmk80xx_driver = {
Expand Down Expand Up @@ -1382,30 +1396,7 @@ static int vmk80xx_usb_probe(struct usb_interface *intf,

static void vmk80xx_usb_disconnect(struct usb_interface *intf)
{
struct vmk80xx_usb *dev = usb_get_intfdata(intf);

if (!dev)
return;

comedi_usb_auto_unconfig(intf);

mutex_lock(&glb_mutex);
down(&dev->limit_sem);

dev->probed = 0;
usb_set_intfdata(dev->intf, NULL);

usb_kill_anchored_urbs(&dev->rx_anchor);
usb_kill_anchored_urbs(&dev->tx_anchor);

kfree(dev->usb_rx_buf);
kfree(dev->usb_tx_buf);

dev_info(&intf->dev, "board #%d [%s] now detached\n",
dev->count, dev->board.name);

up(&dev->limit_sem);
mutex_unlock(&glb_mutex);
}

static const struct usb_device_id vmk80xx_usb_id_table[] = {
Expand Down

0 comments on commit a95af55

Please sign in to comment.