Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317151
b: refs/heads/master
c: 181ad5e
h: refs/heads/master
i:
  317149: 6b033ab
  317147: 5736123
  317143: 62ca9d5
  317135: b672e34
  317119: cea8c05
v: v3
  • Loading branch information
Ian Abbott authored and Greg Kroah-Hartman committed Jun 5, 2012
1 parent f619534 commit a2b0dd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 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: 485455d01b26e849d30c2b20ce20a4d6fc50555e
refs/heads/master: 181ad5edbf6d3c244263b770e9dd4eda645de5bf
20 changes: 8 additions & 12 deletions trunk/drivers/staging/comedi/drivers/amplc_dio200.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,14 +463,11 @@ struct dio200_subdev_intr {
* This function looks for a PCI device matching the requested board name,
* bus and slot.
*/
static int
dio200_find_pci(struct comedi_device *dev, int bus, int slot,
struct pci_dev **pci_dev_p)
static struct pci_dev *
dio200_find_pci(struct comedi_device *dev, int bus, int slot)
{
struct pci_dev *pci_dev = NULL;

*pci_dev_p = NULL;

/* Look for matching PCI device. */
for (pci_dev = pci_get_device(PCI_VENDOR_ID_AMPLICON, PCI_ANY_ID, NULL);
pci_dev != NULL;
Expand Down Expand Up @@ -504,8 +501,7 @@ dio200_find_pci(struct comedi_device *dev, int bus, int slot,
}

/* Found a match. */
*pci_dev_p = pci_dev;
return 0;
return pci_dev;
}
/* No match found. */
if (bus || slot) {
Expand All @@ -516,7 +512,7 @@ dio200_find_pci(struct comedi_device *dev, int bus, int slot,
dev_err(dev->class_dev, "error! no %s found!\n",
thisboard->name);
}
return -EIO;
return NULL;
}

/*
Expand Down Expand Up @@ -1293,15 +1289,15 @@ static int dio200_attach(struct comedi_device *dev, struct comedi_devconfig *it)
return ret;
} else if (IS_ENABLED(CONFIG_COMEDI_AMPLC_DIO200_PCI) &&
thisboard->bustype == pci_bustype) {
struct pci_dev *pci_dev = NULL;
struct pci_dev *pci_dev;
int bus, slot;

bus = it->options[0];
slot = it->options[1];
share_irq = 1;
ret = dio200_find_pci(dev, bus, slot, &pci_dev);
if (ret < 0)
return ret;
pci_dev = dio200_find_pci(dev, bus, slot);
if (pci_dev == NULL)
return -EIO;
devpriv->pci_dev = pci_dev;
ret = comedi_pci_enable(pci_dev, DIO200_DRIVER_NAME);
if (ret < 0) {
Expand Down

0 comments on commit a2b0dd3

Please sign in to comment.