Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318101
b: refs/heads/master
c: e3ab476
h: refs/heads/master
i:
  318099: 496f736
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 97a9e37 commit d16743f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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: b8acd7750a2366216d9ec81f96b0594f6bb86707
refs/heads/master: e3ab476bee2c4b038ca9c8e3a2c2fd79f7403749
13 changes: 6 additions & 7 deletions trunk/drivers/staging/comedi/drivers/contec_pci_dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ static const struct contec_board contec_boards[] = {

struct contec_private {
int data;

struct pci_dev *pci_dev;

};

#define devpriv ((struct contec_private *)dev->private)
Expand Down Expand Up @@ -143,7 +140,7 @@ static int contec_attach(struct comedi_device *dev, struct comedi_devconfig *it)
pcidev = contec_find_pci_dev(dev, it);
if (!pcidev)
return -EIO;
devpriv->pci_dev = pcidev;
comedi_set_hw_dev(dev, &pcidev->dev);

if (comedi_pci_enable(pcidev, "contec_pci_dio")) {
printk("error enabling PCI device and request regions!\n");
Expand Down Expand Up @@ -176,10 +173,12 @@ static int contec_attach(struct comedi_device *dev, struct comedi_devconfig *it)

static void contec_detach(struct comedi_device *dev)
{
if (devpriv && devpriv->pci_dev) {
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev) {
if (dev->iobase)
comedi_pci_disable(devpriv->pci_dev);
pci_dev_put(devpriv->pci_dev);
comedi_pci_disable(pcidev);
pci_dev_put(pcidev);
}
}

Expand Down

0 comments on commit d16743f

Please sign in to comment.