Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318067
b: refs/heads/master
c: 983ff48
h: refs/heads/master
i:
  318065: d9fead0
  318063: 2f75be9
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 802a7c8 commit e186ab8
Show file tree
Hide file tree
Showing 2 changed files with 13 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: 096de334d9209daff1595c056f89695f6ad35d6c
refs/heads/master: 983ff48833061b71e37d15b618198ef65b242ca0
23 changes: 12 additions & 11 deletions trunk/drivers/staging/comedi/drivers/adv_pci_dio.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@ static const struct dio_boardtype boardtypes[] = {
};

struct pci_dio_private {
struct pci_dev *pcidev; /* pointer to board's pci_dev */
char valid; /* card is usable */
char GlobalIrqEnabled; /* 1= any IRQ source is enabled */
/* PCI-1760 specific data */
Expand Down Expand Up @@ -1085,25 +1084,26 @@ static struct pci_dev *pci_dio_find_pci_dev(struct comedi_device *dev,
static int pci_dio_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev;
struct comedi_subdevice *s;
int ret, subdev, n_subdevices, i, j;

ret = alloc_private(dev, sizeof(struct pci_dio_private));
if (ret < 0)
return -ENOMEM;

devpriv->pcidev = pci_dio_find_pci_dev(dev, it);
if (!devpriv->pcidev)
pcidev = pci_dio_find_pci_dev(dev, it);
if (!pcidev)
return -EIO;
comedi_set_hw_dev(dev, &pcidev->dev);

if (comedi_pci_enable(devpriv->pcidev, dev->driver->driver_name)) {
if (comedi_pci_enable(pcidev, dev->driver->driver_name)) {
dev_err(dev->class_dev,
"Error: Can't enable PCI device and request regions!\n");
return -EIO;
}

dev->iobase = pci_resource_start(devpriv->pcidev,
this_board->main_pci_region);
dev->iobase = pci_resource_start(pcidev, this_board->main_pci_region);
dev->board_name = this_board->name;

if (this_board->cardtype == TYPE_PCI1760) {
Expand Down Expand Up @@ -1180,6 +1180,7 @@ static int pci_dio_attach(struct comedi_device *dev,

static void pci_dio_detach(struct comedi_device *dev)
{
struct pci_dev *pcidev = comedi_to_pci_dev(dev);
int i, j;
struct comedi_subdevice *s;
int subdev;
Expand Down Expand Up @@ -1212,11 +1213,11 @@ static void pci_dio_detach(struct comedi_device *dev)
s = dev->subdevices + i;
s->private = NULL;
}
if (devpriv->pcidev) {
if (dev->iobase)
comedi_pci_disable(devpriv->pcidev);
pci_dev_put(devpriv->pcidev);
}
}
if (pcidev) {
if (dev->iobase)
comedi_pci_disable(pcidev);
pci_dev_put(pcidev);
}
}

Expand Down

0 comments on commit e186ab8

Please sign in to comment.