diff options
| author | H Hartley Sweeten <hartleys@visionengravers.com> | 2012-10-29 21:07:01 +0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-10-30 21:44:48 +0400 |
| commit | 8a799460c280568e3c59bcc84f3443035468486f (patch) | |
| tree | 04c2c51b35900a0378f8f4c74d81987ee64be874 | |
| parent | 5d55a30c50a3740b415080ce9a9c7b2c642daec7 (diff) | |
| download | linux-8a799460c280568e3c59bcc84f3443035468486f.tar.xz | |
staging: comedi: rtd520: remove 'aiMaxGain' from boardinfo
This value is only used in the attach to determine which range
table the analog input subdevice uses. Remove this variable and
just pass the range table pointer in the boardinfo.
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/rtd520.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c index de15350bb603..dc470ef9135a 100644 --- a/drivers/staging/comedi/drivers/rtd520.c +++ b/drivers/staging/comedi/drivers/rtd520.c @@ -252,24 +252,24 @@ static const struct comedi_lrange rtd_ao_range = { struct rtdBoard { const char *name; int device_id; - int aiMaxGain; int range10Start; /* start of +-10V range */ int rangeUniStart; /* start of +10V range */ + const struct comedi_lrange *ai_range; }; static const struct rtdBoard rtd520Boards[] = { { .name = "DM7520", .device_id = 0x7520, - .aiMaxGain = 32, .range10Start = 6, .rangeUniStart = 12, + .ai_range = &rtd_ai_7520_range, }, { .name = "PCI4520", .device_id = 0x4520, - .aiMaxGain = 128, .range10Start = 8, .rangeUniStart = 16, + .ai_range = &rtd_ai_4520_range, }, }; @@ -1336,10 +1336,7 @@ static int rtd_attach_pci(struct comedi_device *dev, struct pci_dev *pcidev) s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON | SDF_DIFF; s->n_chan = 16; s->maxdata = 0x0fff; - if (thisboard->aiMaxGain <= 32) - s->range_table = &rtd_ai_7520_range; - else - s->range_table = &rtd_ai_4520_range; + s->range_table = thisboard->ai_range; s->len_chanlist = RTD_MAX_CHANLIST; /* devpriv->fifoLen */ s->insn_read = rtd_ai_rinsn; |
