Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318062
b: refs/heads/master
c: 5f5d1b9
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 4213180 commit 5915b18
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 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: 5aa53d5f2e9cf38112b8087ead926fcaacaa5abe
refs/heads/master: 5f5d1b9ac13d44f370a3f7ebfc624b7f6cca4c19
15 changes: 6 additions & 9 deletions trunk/drivers/staging/comedi/drivers/adv_pci1710.c
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,8 @@ static struct pci_dev *pci1710_find_pci_dev(struct comedi_device *dev,
}
if (pcidev->vendor != PCI_VENDOR_ID_ADVANTECH)
continue;
if (pci_is_enabled(pcidev))
continue;

if (strcmp(this_board->name, DRV_NAME) == 0) {
for (i = 0; i < ARRAY_SIZE(boardtypes); ++i) {
Expand All @@ -1364,15 +1366,6 @@ static struct pci_dev *pci1710_find_pci_dev(struct comedi_device *dev,
if (pcidev->device != boardtypes[board_index].device_id)
continue;
}

/*
* Look for device that isn't in use.
* Enable PCI device and request regions.
*/
if (comedi_pci_enable(pcidev, DRV_NAME)) {
continue;
}
/* fixup board_ptr in case we were using the dummy entry with the driver name */
dev->board_ptr = &boardtypes[board_index];
return pcidev;
}
Expand All @@ -1399,6 +1392,10 @@ static int pci1710_attach(struct comedi_device *dev,
if (!devpriv->pcidev)
return -EIO;

ret = comedi_pci_enable(devpriv->pcidev, DRV_NAME);
if (ret)
return ret;

dev->iobase = pci_resource_start(devpriv->pcidev, 2);
irq = devpriv->pcidev->irq;

Expand Down

0 comments on commit 5915b18

Please sign in to comment.