Skip to content

Commit

Permalink
staging: comedi: vmk80xx: remove common and unused boardinfo
Browse files Browse the repository at this point in the history
Some of the information in the boardinfo is common for both boards
supported by this driver. Remove that information from the boardinfo
and just initialize the subdevice values directly.

Also, remove any information in the boardinfo that is not used 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>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Feb 6, 2013
1 parent 0dd772b commit 70ba1a5
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions drivers/staging/comedi/drivers/vmk80xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,12 +162,7 @@ struct vmk80xx_board {
__u8 ai_chans;
__le16 ai_bits;
__u8 ao_chans;
__le16 ao_bits;
__u8 di_chans;
__le16 di_bits;
__u8 do_chans;
__le16 do_bits;
__u8 cnt_chans;
__le16 cnt_bits;
__u8 pwm_chans;
__le16 pwm_bits;
Expand All @@ -181,12 +176,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = {
.ai_chans = 2,
.ai_bits = 8,
.ao_chans = 2,
.ao_bits = 8,
.di_chans = 6,
.di_bits = 1,
.do_chans = 8,
.do_bits = 1,
.cnt_chans = 2,
.cnt_bits = 16,
.pwm_chans = 0,
.pwm_bits = 0,
Expand All @@ -198,12 +188,7 @@ static const struct vmk80xx_board vmk80xx_boardinfo[] = {
.ai_chans = 8,
.ai_bits = 10,
.ao_chans = 8,
.ao_bits = 8,
.di_chans = 8,
.di_bits = 1,
.do_chans = 8,
.do_bits = 1,
.cnt_chans = 2,
.cnt_bits = 0,
.pwm_chans = 1,
.pwm_bits = 10,
Expand Down Expand Up @@ -1187,7 +1172,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND;
s->n_chan = boardinfo->ao_chans;
s->maxdata = (1 << boardinfo->ao_bits) - 1;
s->maxdata = 0x00ff;
s->range_table = boardinfo->range;
s->insn_write = vmk80xx_ao_winsn;
if (boardinfo->model == VMK8061_MODEL) {
Expand All @@ -1208,7 +1193,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
s = &cdev->subdevices[VMK80XX_SUBD_DO];
s->type = COMEDI_SUBD_DO;
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND;
s->n_chan = boardinfo->do_chans;
s->n_chan = 8;
s->maxdata = 1;
s->insn_write = vmk80xx_do_winsn;
s->insn_bits = vmk80xx_do_bits;
Expand All @@ -1221,7 +1206,7 @@ static int vmk80xx_attach_common(struct comedi_device *cdev,
s = &cdev->subdevices[VMK80XX_SUBD_CNT];
s->type = COMEDI_SUBD_COUNTER;
s->subdev_flags = SDF_READABLE;
s->n_chan = boardinfo->cnt_chans;
s->n_chan = 2;
s->insn_read = vmk80xx_cnt_rinsn;
s->insn_config = vmk80xx_cnt_cinsn;
if (boardinfo->model == VMK8055_MODEL) {
Expand Down

0 comments on commit 70ba1a5

Please sign in to comment.