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

staging: comedi: pcmad: change boardinfo 'n_ai_bits' to 'ai_maxdata'

This information is only used to set the subdevice 'maxdata'. Change
it so the calculation is not needed.
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 624b6530
...@@ -50,16 +50,16 @@ ...@@ -50,16 +50,16 @@
struct pcmad_board_struct { struct pcmad_board_struct {
const char *name; const char *name;
int n_ai_bits; unsigned int ai_maxdata;
}; };
static const struct pcmad_board_struct pcmad_boards[] = { static const struct pcmad_board_struct pcmad_boards[] = {
{ {
.name = "pcmad12", .name = "pcmad12",
.n_ai_bits = 12, .ai_maxdata = 0x0fff,
}, { }, {
.name = "pcmad16", .name = "pcmad16",
.n_ai_bits = 16, .ai_maxdata = 0xffff,
}, },
}; };
...@@ -137,7 +137,7 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -137,7 +137,7 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->subdev_flags = SDF_READABLE | AREF_GROUND; s->subdev_flags = SDF_READABLE | AREF_GROUND;
s->n_chan = 16; s->n_chan = 16;
s->len_chanlist = 1; s->len_chanlist = 1;
s->maxdata = (1 << board->n_ai_bits) - 1; s->maxdata = board->ai_maxdata;
s->range_table = &range_unknown; s->range_table = &range_unknown;
s->insn_read = pcmad_ai_insn_read; s->insn_read = pcmad_ai_insn_read;
......
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