Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317965
b: refs/heads/master
c: 26550b3
h: refs/heads/master
i:
  317963: 108998a
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 16, 2012
1 parent 9c9a2ca commit 929d028
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 25 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: 7a819d1e5a40189ab94282dc0e42b76c7f52df8d
refs/heads/master: 26550b32e1640020c1aea2e5ccd857b0ddd84b82
43 changes: 19 additions & 24 deletions trunk/drivers/staging/comedi/drivers/rtd520.c
Original file line number Diff line number Diff line change
Expand Up @@ -1608,36 +1608,31 @@ static int rtd_dio_insn_config(struct comedi_device *dev,
static struct pci_dev *rtd_find_pci(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev;

for (pcidev = pci_get_device(PCI_VENDOR_ID_RTD, PCI_ANY_ID, NULL);
pcidev != NULL;
pcidev = pci_get_device(PCI_VENDOR_ID_RTD, PCI_ANY_ID, pcidev)) {
int i;
const struct rtdBoard *thisboard;
struct pci_dev *pcidev = NULL;
int bus = it->options[0];
int slot = it->options[1];
int i;

if (it->options[0] || it->options[1]) {
if (pcidev->bus->number != it->options[0]
|| PCI_SLOT(pcidev->devfn) != it->options[1]) {
for_each_pci_dev(pcidev) {
if (pcidev->vendor != PCI_VENDOR_ID_RTD)
continue;
if (bus || slot) {
if (pcidev->bus->number != bus ||
PCI_SLOT(pcidev->devfn) != slot)
continue;
}
}
for (i = 0; i < ARRAY_SIZE(rtd520Boards); ++i) {
if (pcidev->device == rtd520Boards[i].device_id) {
dev->board_ptr = &rtd520Boards[i];
break;
for (i = 0; i < ARRAY_SIZE(rtd520Boards); i++) {
thisboard = &rtd520Boards[i];
if (pcidev->device == thisboard->device_id) {
dev->board_ptr = thisboard;
return pcidev;
}
}
if (dev->board_ptr)
return pcidev; /* found one */
}
if (!pcidev) {
if (it->options[0] && it->options[1]) {
printk(KERN_INFO "No RTD card at bus=%d slot=%d.\n",
it->options[0], it->options[1]);
} else {
printk(KERN_INFO "No RTD card found.\n");
}
}
dev_warn(dev->class_dev,
"no supported board found! (req. bus/slot: %d/%d)\n",
bus, slot);
return NULL;
}

Expand Down

0 comments on commit 929d028

Please sign in to comment.