Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 337876
b: refs/heads/master
c: e32a32c
h: refs/heads/master
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Nov 13, 2012
1 parent 5e72d35 commit 6314693
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 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: ed168d0a20f4b8e666e188ff43b2663099cd4b01
refs/heads/master: e32a32c9098c745048e28c2851ac356763d3bbba
20 changes: 5 additions & 15 deletions trunk/drivers/staging/comedi/drivers/addi_apci_1516.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ struct apci1516_private {

struct apci1516_boardinfo {
const char *name;
unsigned short vendor;
unsigned short device;
int di_nchan;
int do_nchan;
Expand All @@ -19,19 +18,16 @@ struct apci1516_boardinfo {
static const struct apci1516_boardinfo apci1516_boardtypes[] = {
{
.name = "apci1016",
.vendor = PCI_VENDOR_ID_ADDIDATA,
.device = 0x1000,
.di_nchan = 16,
}, {
.name = "apci1516",
.vendor = PCI_VENDOR_ID_ADDIDATA,
.device = 0x1001,
.di_nchan = 8,
.do_nchan = 8,
.has_timer = 1,
}, {
.name = "apci2016",
.vendor = PCI_VENDOR_ID_ADDIDATA,
.device = 0x1002,
.do_nchan = 16,
.has_timer = 1,
Expand All @@ -54,19 +50,16 @@ static int apci1516_reset(struct comedi_device *dev)
return 0;
}

static const void *addi_find_boardinfo(struct comedi_device *dev,
struct pci_dev *pcidev)
static const void *apci1516_find_boardinfo(struct comedi_device *dev,
struct pci_dev *pcidev)
{
const void *p = dev->driver->board_name;
const struct apci1516_boardinfo *this_board;
int i;

for (i = 0; i < dev->driver->num_names; i++) {
this_board = p;
if (this_board->vendor == pcidev->vendor &&
this_board->device == pcidev->device)
this_board = &apci1516_boardtypes[i];
if (this_board->device == pcidev->device)
return this_board;
p += dev->driver->offset;
}
return NULL;
}
Expand All @@ -80,7 +73,7 @@ static int __devinit apci1516_auto_attach(struct comedi_device *dev,
struct comedi_subdevice *s;
int ret;

this_board = addi_find_boardinfo(dev, pcidev);
this_board = apci1516_find_boardinfo(dev, pcidev);
if (!this_board)
return -ENODEV;
dev->board_ptr = this_board;
Expand Down Expand Up @@ -169,9 +162,6 @@ static struct comedi_driver apci1516_driver = {
.module = THIS_MODULE,
.auto_attach = apci1516_auto_attach,
.detach = apci1516_detach,
.num_names = ARRAY_SIZE(apci1516_boardtypes),
.board_name = &apci1516_boardtypes[0].name,
.offset = sizeof(struct apci1516_boardinfo),
};

static int __devinit apci1516_pci_probe(struct pci_dev *dev,
Expand Down

0 comments on commit 6314693

Please sign in to comment.