diff options
author | 2015-08-05 10:44:39 -0700 | |
---|---|---|
committer | 2015-08-07 15:03:27 -0700 | |
commit | 14aa4789f0519d0d97f6bf672a077582b08f2cf6 (patch) | |
tree | 698f52ff10d195cf2a9408406ffff8a7ec679910 /drivers/staging/comedi/drivers/me4000.c | |
parent | staging: comedi: me4000: remove 'dio_nchan' boardinfo (diff) | |
download | linux-dev-14aa4789f0519d0d97f6bf672a077582b08f2cf6.tar.xz linux-dev-14aa4789f0519d0d97f6bf672a077582b08f2cf6.zip |
staging: comedi: me4000: all board types have analog inputs
All the boards supported by this driver have analog inputs. They just
differ in the number of channels (32 or 16).
Always initialize the analog input subdevice in me4000_auto_attach().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/me4000.c')
-rw-r--r-- | drivers/staging/comedi/drivers/me4000.c | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/drivers/staging/comedi/drivers/me4000.c b/drivers/staging/comedi/drivers/me4000.c index 2b37c5354a33..3d45217e9e18 100644 --- a/drivers/staging/comedi/drivers/me4000.c +++ b/drivers/staging/comedi/drivers/me4000.c @@ -1281,31 +1281,22 @@ static int me4000_auto_attach(struct comedi_device *dev, if (result) return result; - /*========================================================================= - Analog input subdevice - ========================================================================*/ - + /* Analog Input subdevice */ s = &dev->subdevices[0]; - - if (board->ai_nchan) { - s->type = COMEDI_SUBD_AI; - s->subdev_flags = - SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF; - s->n_chan = board->ai_nchan; - s->maxdata = 0xFFFF; /* 16 bit ADC */ - s->len_chanlist = ME4000_AI_CHANNEL_LIST_COUNT; - s->range_table = &me4000_ai_range; - s->insn_read = me4000_ai_insn_read; - - if (dev->irq) { - dev->read_subdev = s; - s->subdev_flags |= SDF_CMD_READ; - s->cancel = me4000_ai_cancel; - s->do_cmdtest = me4000_ai_do_cmd_test; - s->do_cmd = me4000_ai_do_cmd; - } - } else { - s->type = COMEDI_SUBD_UNUSED; + s->type = COMEDI_SUBD_AI; + s->subdev_flags = SDF_READABLE | SDF_COMMON | SDF_GROUND | SDF_DIFF; + s->n_chan = board->ai_nchan; + s->maxdata = 0xffff; + s->len_chanlist = ME4000_AI_CHANNEL_LIST_COUNT; + s->range_table = &me4000_ai_range; + s->insn_read = me4000_ai_insn_read; + + if (dev->irq) { + dev->read_subdev = s; + s->subdev_flags |= SDF_CMD_READ; + s->cancel = me4000_ai_cancel; + s->do_cmdtest = me4000_ai_do_cmd_test; + s->do_cmd = me4000_ai_do_cmd; } /*========================================================================= |