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

staging: comedi: pcl812: all board types have analog inputs

All the boards supported by this driver have 16 or 32 analog input
channels.

Remove the unnecessary check in pcl812_attach() to reduce the indent
level of the code.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f39b8ccf
......@@ -1422,9 +1422,7 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->hwdmasize[1] = PAGE_SIZE * (1 << pages);
}
n_subdevices = 0;
if (board->n_aichan > 0)
n_subdevices++;
n_subdevices = 1; /* all boardtypes have analog inputs */
if (board->n_aochan > 0)
n_subdevices++;
if (board->has_dio)
......@@ -1436,8 +1434,7 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
subdev = 0;
/* analog input */
if (board->n_aichan > 0) {
/* Analog Input subdevice */
s = &dev->subdevices[subdev];
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE;
......@@ -1477,7 +1474,6 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
else
s->insn_read = pcl812_ai_insn_read;
devpriv->use_MPC = board->has_mpc508_mux;
if (dev->irq) {
dev->read_subdev = s;
s->subdev_flags |= SDF_CMD_READ;
......@@ -1487,8 +1483,10 @@ static int pcl812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
s->poll = pcl812_ai_poll;
s->cancel = pcl812_ai_cancel;
}
devpriv->use_MPC = board->has_mpc508_mux;
subdev++;
}
/* analog output */
if (board->n_aochan > 0) {
......
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