diff options
author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-10-08 10:45:22 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-22 11:51:31 -0700 |
commit | c937876787c4f7aaca421fbb07d0e763e70ff6fa (patch) | |
tree | 59fdc3c9936c2ab87c6f0507185cbcdf52fb340e | |
parent | 5f1514bfd2ffa5e4333c037378a0b0d8db79ce23 (diff) | |
download | op-kernel-dev-c937876787c4f7aaca421fbb07d0e763e70ff6fa.zip op-kernel-dev-c937876787c4f7aaca421fbb07d0e763e70ff6fa.tar.gz |
staging: comedi: ke_counter: remove boardinfo
This driver only supports a single "boardtype". Remove the unneeded
boardinfo struct and its use in the 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>
-rw-r--r-- | drivers/staging/comedi/drivers/ke_counter.c | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/drivers/staging/comedi/drivers/ke_counter.c b/drivers/staging/comedi/drivers/ke_counter.c index e867b72..8e37cff1 100644 --- a/drivers/staging/comedi/drivers/ke_counter.c +++ b/drivers/staging/comedi/drivers/ke_counter.c @@ -36,28 +36,9 @@ Kolter Electronic PCI Counter Card. #include "../comedidev.h" -#define CNT_DRIVER_NAME "ke_counter" #define PCI_VENDOR_ID_KOLTER 0x1001 #define CNT_CARD_DEVICE_ID 0x0014 -/*-- board specification structure ------------------------------------------*/ - -struct cnt_board_struct { - - const char *name; - int device_id; - int cnt_channel_nbr; - int cnt_bits; -}; - -static const struct cnt_board_struct cnt_boards[] = { - { - .name = CNT_DRIVER_NAME, - .device_id = CNT_CARD_DEVICE_ID, - .cnt_channel_nbr = 3, - .cnt_bits = 24} -}; - /*-- counter write ----------------------------------------------------------*/ /* This should be used only for resetting the counters; maybe it is better @@ -107,34 +88,15 @@ static int cnt_rinsn(struct comedi_device *dev, return 1; } -static const void *cnt_find_boardinfo(struct comedi_device *dev, - struct pci_dev *pcidev) -{ - const struct cnt_board_struct *board; - int i; - - for (i = 0; i < ARRAY_SIZE(cnt_boards); i++) { - board = &cnt_boards[i]; - if (board->device_id == pcidev->device) - return board; - } - return NULL; -} - static int cnt_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) { - const struct cnt_board_struct *board; struct comedi_subdevice *s; int ret; comedi_set_hw_dev(dev, &pcidev->dev); - board = cnt_find_boardinfo(dev, pcidev); - if (!board) - return -ENODEV; - dev->board_ptr = board; - dev->board_name = board->name; + dev->board_name = dev->driver->driver_name; ret = comedi_pci_enable(pcidev, dev->board_name); if (ret) @@ -150,8 +112,8 @@ static int cnt_attach_pci(struct comedi_device *dev, s->type = COMEDI_SUBD_COUNTER; s->subdev_flags = SDF_READABLE /* | SDF_COMMON */ ; - s->n_chan = board->cnt_channel_nbr; - s->maxdata = (1 << board->cnt_bits) - 1; + s->n_chan = 3; + s->maxdata = 0x00ffffff; s->insn_read = cnt_rinsn; s->insn_write = cnt_winsn; |