}
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) {
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;
}
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;