Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 324595
b: refs/heads/master
c: 86476d9
h: refs/heads/master
i:
  324593: ea1e8e1
  324591: 3ba5790
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Aug 17, 2012
1 parent 9dbb44d commit 5240c38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 31 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: accff3509e947a4c1f7c88aec7e41d14f6c6f51e
refs/heads/master: 86476d9f7cdffbe51396a1c0597d621a670d337d
38 changes: 8 additions & 30 deletions trunk/drivers/staging/comedi/drivers/cb_pcimdda.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,6 @@ Configuration Options:
#define PCIMDDA_DA_CHAN(x) (0x00 + (x) * 2)
#define PCIMDDA_8255_BASE_REG 0x0c

/*
* This is straight from skel.c -- I did this in case this source file
* will someday support more than 1 board...
*/
struct cb_pcimdda_board {
const char *name;
unsigned short device_id;
};

static const struct cb_pcimdda_board cb_pcimdda_boards[] = {
{
.name = "cb_pcimdda06-16",
.device_id = PCI_ID_PCIM_DDA06_16,
}
};

/*
* this structure is for data unique to this hardware driver. If
* several hardware drivers keep similar information in this structure,
Expand Down Expand Up @@ -197,32 +181,27 @@ static struct pci_dev *cb_pcimdda_probe(struct comedi_device *dev,
struct comedi_devconfig *it)
{
struct pci_dev *pcidev = NULL;
int index;

for_each_pci_dev(pcidev) {
if (pcidev->vendor != PCI_VENDOR_ID_COMPUTERBOARDS)
continue;
for (index = 0; index < ARRAY_SIZE(cb_pcimdda_boards); index++) {
if (cb_pcimdda_boards[index].device_id != pcidev->device)
if (pcidev->device != PCI_ID_PCIM_DDA06_16)
continue;
if (it->options[0] || it->options[1]) {
if (pcidev->bus->number != it->options[0] ||
PCI_SLOT(pcidev->devfn) != it->options[1]) {
continue;
if (it->options[0] || it->options[1]) {
if (pcidev->bus->number != it->options[0] ||
PCI_SLOT(pcidev->devfn) != it->options[1]) {
continue;
}
}

dev->board_ptr = cb_pcimdda_boards + index;
return pcidev;
}

return pcidev;
}
return NULL;
}

static int cb_pcimdda_attach(struct comedi_device *dev,
struct comedi_devconfig *it)
{
const struct cb_pcimdda_board *thisboard;
struct cb_pcimdda_private *devpriv;
struct pci_dev *pcidev;
struct comedi_subdevice *s;
Expand All @@ -237,8 +216,7 @@ static int cb_pcimdda_attach(struct comedi_device *dev,
if (!pcidev)
return -EIO;
comedi_set_hw_dev(dev, &pcidev->dev);
thisboard = comedi_board(dev);
dev->board_name = thisboard->name;
dev->board_name = dev->driver->driver_name;

ret = comedi_pci_enable(pcidev, dev->board_name);
if (ret)
Expand Down

0 comments on commit 5240c38

Please sign in to comment.