Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318087
b: refs/heads/master
c: 04cec90
h: refs/heads/master
i:
  318085: 3a93480
  318083: 8d9681b
  318079: 2136ee3
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 0e06034 commit 5e7be88
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 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: 5b7c52a78da910a198d743c2b32aa7a93e7a540a
refs/heads/master: 04cec90cd356016296af3030b12aacabd891f393
23 changes: 10 additions & 13 deletions trunk/drivers/staging/comedi/drivers/cb_pcidda.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,6 @@ static const struct cb_pcidda_board cb_pcidda_boards[] = {
struct cb_pcidda_private {
int data;

/* would be useful for a PCI device */
struct pci_dev *pci_dev;

unsigned long digitalio;
unsigned long dac;

Expand Down Expand Up @@ -306,7 +303,7 @@ static int cb_pcidda_attach(struct comedi_device *dev,
pcidev = cb_pcidda_find_pci_dev(dev, it);
if (!pcidev)
return -EIO;
devpriv->pci_dev = pcidev;
comedi_set_hw_dev(dev, &pcidev->dev);

/*
* Enable PCI device and request regions.
Expand All @@ -320,9 +317,9 @@ static int cb_pcidda_attach(struct comedi_device *dev,
/*
* Allocate the I/O ports.
*/
devpriv->digitalio =
pci_resource_start(devpriv->pci_dev, DIGITALIO_BADRINDEX);
devpriv->dac = pci_resource_start(devpriv->pci_dev, DAC_BADRINDEX);
devpriv->digitalio = pci_resource_start(pcidev, DIGITALIO_BADRINDEX);
devpriv->dac = pci_resource_start(pcidev, DAC_BADRINDEX);
dev->iobase = devpriv->dac;

/*
* Warn about the status of the driver.
Expand Down Expand Up @@ -377,12 +374,12 @@ static int cb_pcidda_attach(struct comedi_device *dev,

static void cb_pcidda_detach(struct comedi_device *dev)
{
if (devpriv) {
if (devpriv->pci_dev) {
if (devpriv->dac)
comedi_pci_disable(devpriv->pci_dev);
pci_dev_put(devpriv->pci_dev);
}
struct pci_dev *pcidev = comedi_to_pci_dev(dev);

if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
pci_dev_put(pcidev);
}
if (dev->subdevices) {
subdev_8255_cleanup(dev, dev->subdevices + 1);
Expand Down

0 comments on commit 5e7be88

Please sign in to comment.