Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318080
b: refs/heads/master
c: 2605d35
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 19, 2012
1 parent 2136ee3 commit 7cc114b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 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: 415417040fbe26160c381b7e147408aacc814a96
refs/heads/master: 2605d35b439da85634db975d98bc7be76f9d563a
22 changes: 8 additions & 14 deletions trunk/drivers/staging/comedi/drivers/amplc_pci230.c
Original file line number Diff line number Diff line change
Expand Up @@ -2683,11 +2683,13 @@ static const struct pci230_board *pci230_find_pci_board(struct pci_dev *pci_dev)
}

/* Look for PCI device matching requested board name, bus and slot. */
static struct pci_dev *pci230_find_pci(struct comedi_device *dev,
int bus, int slot)
static struct pci_dev *pci230_find_pci_dev(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct pci230_board *thisboard = comedi_board(dev);
struct pci_dev *pci_dev = NULL;
int bus = it->options[0];
int slot = it->options[1];

for_each_pci_dev(pci_dev) {
/* Check vendor ID (same for all supported PCI boards). */
Expand All @@ -2707,23 +2709,16 @@ static struct pci_dev *pci230_find_pci(struct comedi_device *dev,
continue;
/* Replace wildcard board_ptr. */
dev->board_ptr = foundboard;
thisboard = comedi_board(dev);
} else {
/* Need to match a specific board. */
if (!pci230_match_pci_board(thisboard, pci_dev))
continue;
}
/* Found a matching PCI device. */
return pci_dev;
}
/* No matching PCI device found. */
if (bus || slot)
dev_err(dev->class_dev,
"error! no %s found at pci %02x:%02x\n",
thisboard->name, bus, slot);
else
dev_err(dev->class_dev,
"error! no %s found\n", thisboard->name);
dev_err(dev->class_dev,
"No supported board found! (req. bus %d, slot %d)\n",
bus, slot);
return NULL;
}

Expand Down Expand Up @@ -2909,8 +2904,7 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
rc = pci230_alloc_private(dev); /* sets dev->private */
if (rc)
return rc;
/* Find card. */
pci_dev = pci230_find_pci(dev, it->options[0], it->options[1]);
pci_dev = pci230_find_pci_dev(dev, it);
if (!pci_dev)
return -EIO;
return pci230_attach_common(dev, pci_dev);
Expand Down

0 comments on commit 7cc114b

Please sign in to comment.