mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-04 10:12:16 +09:00
staging: comedi: addi_apci_035: remove unnecessary subdevice initialization
The subdevices that don't initialize any of the callbacks don't really exist. Remove the unnecessary initialzation and just set the type to COMEDI_SUBD_UNUSED. 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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
1881c0f3b9
commit
8d3e0bf092
@@ -145,43 +145,15 @@ static int apci035_auto_attach(struct comedi_device *dev,
|
||||
|
||||
/* Allocate and Initialise AO Subdevice Structures */
|
||||
s = &dev->subdevices[1];
|
||||
if (devpriv->s_EeParameters.i_NbrAoChannel) {
|
||||
s->type = COMEDI_SUBD_AO;
|
||||
s->subdev_flags = SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
|
||||
s->n_chan = devpriv->s_EeParameters.i_NbrAoChannel;
|
||||
s->maxdata = devpriv->s_EeParameters.i_AoMaxdata;
|
||||
s->len_chanlist =
|
||||
devpriv->s_EeParameters.i_NbrAoChannel;
|
||||
} else {
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
}
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
|
||||
/* Allocate and Initialise DI Subdevice Structures */
|
||||
s = &dev->subdevices[2];
|
||||
if (devpriv->s_EeParameters.i_NbrDiChannel) {
|
||||
s->type = COMEDI_SUBD_DI;
|
||||
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_COMMON;
|
||||
s->n_chan = devpriv->s_EeParameters.i_NbrDiChannel;
|
||||
s->maxdata = 1;
|
||||
s->len_chanlist =
|
||||
devpriv->s_EeParameters.i_NbrDiChannel;
|
||||
s->range_table = &range_digital;
|
||||
} else {
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
}
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
|
||||
/* Allocate and Initialise DO Subdevice Structures */
|
||||
s = &dev->subdevices[3];
|
||||
if (devpriv->s_EeParameters.i_NbrDoChannel) {
|
||||
s->type = COMEDI_SUBD_DO;
|
||||
s->subdev_flags =
|
||||
SDF_READABLE | SDF_WRITEABLE | SDF_GROUND | SDF_COMMON;
|
||||
s->n_chan = devpriv->s_EeParameters.i_NbrDoChannel;
|
||||
s->maxdata = devpriv->s_EeParameters.i_DoMaxdata;
|
||||
s->len_chanlist =
|
||||
devpriv->s_EeParameters.i_NbrDoChannel;
|
||||
s->range_table = &range_digital;
|
||||
} else {
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
}
|
||||
s->type = COMEDI_SUBD_UNUSED;
|
||||
|
||||
/* Allocate and Initialise Timer Subdevice Structures */
|
||||
s = &dev->subdevices[4];
|
||||
|
||||
Reference in New Issue
Block a user