summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorH Hartley Sweeten <hartleys@visionengravers.com>2012-11-01 17:31:10 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-11-02 11:23:51 -0700
commit60eebfad7a2191176fd8af323c1fc6821c8cd61a (patch)
tree68595638dc78b2e98a334c69d6f2523359e27665 /drivers
parent7dd2358156285dc525d309dd1347d4fdab5c0773 (diff)
staging: comedi: addi_apci_3120: cleanup addi_find_boardinfo()
This driver uses the comedi PCI auto attach mechanism and the comedi core does not use the boardinfo during the attach. Now that this driver has the attach separated from addi_common.c we can remove passing the boardinfo in the comedi_driver and cleanup the code that finds the boardinfo. Also, rename addi_find_boardinfo() so it has namespace associated with this driver. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_3120.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c
index 9b9ca004635c..da3112624b72 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3120.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3120.c
@@ -45,19 +45,17 @@ static irqreturn_t v_ADDI_Interrupt(int irq, void *d)
return IRQ_RETVAL(1);
}
-static const void *addi_find_boardinfo(struct comedi_device *dev,
- struct pci_dev *pcidev)
+static const void *apci3120_find_boardinfo(struct comedi_device *dev,
+ struct pci_dev *pcidev)
{
- const void *p = dev->driver->board_name;
const struct addi_board *this_board;
int i;
- for (i = 0; i < dev->driver->num_names; i++) {
- this_board = p;
+ for (i = 0; i < ARRAY_SIZE(apci3120_boardtypes); i++) {
+ this_board = &apci3120_boardtypes[i];
if (this_board->i_VendorId == pcidev->vendor &&
this_board->i_DeviceId == pcidev->device)
return this_board;
- p += dev->driver->offset;
}
return NULL;
}
@@ -70,7 +68,7 @@ static int apci3120_attach_pci(struct comedi_device *dev,
struct comedi_subdevice *s;
int ret, pages, i;
- this_board = addi_find_boardinfo(dev, pcidev);
+ this_board = apci3120_find_boardinfo(dev, pcidev);
if (!this_board)
return -ENODEV;
dev->board_ptr = this_board;
@@ -249,9 +247,6 @@ static struct comedi_driver apci3120_driver = {
.module = THIS_MODULE,
.attach_pci = apci3120_attach_pci,
.detach = apci3120_detach,
- .num_names = ARRAY_SIZE(apci3120_boardtypes),
- .board_name = &apci3120_boardtypes[0].pc_DriverName,
- .offset = sizeof(struct addi_board),
};
static int __devinit apci3120_pci_probe(struct pci_dev *dev,