Commit 281ecb06 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: icp_multi: remove n_aichan from boardinfo

There is only one board type supported by this driver and the
number of analog input channels is constant. Remove the
boardinfo for it and just open-code the value.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fafe91a8
...@@ -130,7 +130,6 @@ struct boardtype { ...@@ -130,7 +130,6 @@ struct boardtype {
int iorange; /* I/O range len */ int iorange; /* I/O range len */
char have_irq; /* 1=card support IRQ */ char have_irq; /* 1=card support IRQ */
char cardtype; /* 0=ICP Multi */ char cardtype; /* 0=ICP Multi */
int n_aichan; /* num of A/D chans */
int n_aichand; /* num of A/D chans in diff mode */ int n_aichand; /* num of A/D chans in diff mode */
int ai_maxdata; /* resolution of A/D */ int ai_maxdata; /* resolution of A/D */
int ao_maxdata; /* resolution of D/A */ int ao_maxdata; /* resolution of D/A */
...@@ -650,7 +649,7 @@ static int check_channel_list(struct comedi_device *dev, ...@@ -650,7 +649,7 @@ static int check_channel_list(struct comedi_device *dev,
return 0; return 0;
} }
} else { } else {
if (CR_CHAN(chanlist[i]) > this_board->n_aichan) { if (CR_CHAN(chanlist[i]) > s->n_chan) {
comedi_error(dev, comedi_error(dev,
"Incorrect ai channel number"); "Incorrect ai channel number");
return 0; return 0;
...@@ -769,8 +768,7 @@ static int icp_multi_attach(struct comedi_device *dev, ...@@ -769,8 +768,7 @@ static int icp_multi_attach(struct comedi_device *dev,
dev->board_name = this_board->name; dev->board_name = this_board->name;
n_subdevices = 0; n_subdevices = 0;
if (this_board->n_aichan) n_subdevices++;
n_subdevices++;
n_subdevices++; n_subdevices++;
n_subdevices++; n_subdevices++;
n_subdevices++; n_subdevices++;
...@@ -803,20 +801,18 @@ static int icp_multi_attach(struct comedi_device *dev, ...@@ -803,20 +801,18 @@ static int icp_multi_attach(struct comedi_device *dev,
subdev = 0; subdev = 0;
if (this_board->n_aichan) { s = &dev->subdevices[subdev];
s = &dev->subdevices[subdev]; dev->read_subdev = s;
dev->read_subdev = s; s->type = COMEDI_SUBD_AI;
s->type = COMEDI_SUBD_AI; s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND;
s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND; if (this_board->n_aichand)
if (this_board->n_aichand) s->subdev_flags |= SDF_DIFF;
s->subdev_flags |= SDF_DIFF; s->n_chan = 16;
s->n_chan = this_board->n_aichan; s->maxdata = this_board->ai_maxdata;
s->maxdata = this_board->ai_maxdata; s->len_chanlist = 16;
s->len_chanlist = this_board->n_aichan; s->range_table = this_board->rangelist_ai;
s->range_table = this_board->rangelist_ai; s->insn_read = icp_multi_insn_read_ai;
s->insn_read = icp_multi_insn_read_ai; subdev++;
subdev++;
}
s = &dev->subdevices[subdev]; s = &dev->subdevices[subdev];
s->type = COMEDI_SUBD_AO; s->type = COMEDI_SUBD_AO;
...@@ -890,7 +886,6 @@ static const struct boardtype boardtypes[] = { ...@@ -890,7 +886,6 @@ static const struct boardtype boardtypes[] = {
.iorange = IORANGE_ICP_MULTI, .iorange = IORANGE_ICP_MULTI,
.have_irq = 1, .have_irq = 1,
.cardtype = TYPE_ICP_MULTI, .cardtype = TYPE_ICP_MULTI,
.n_aichan = 16,
.n_aichand = 8, .n_aichand = 8,
.ai_maxdata = 0x0fff, .ai_maxdata = 0x0fff,
.ao_maxdata = 0x0fff, .ao_maxdata = 0x0fff,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment