Skip to content

Commit

Permalink
staging: comedi: cb_das16_cs: cleanup dio subdevice initialization
Browse files Browse the repository at this point in the history
The digital i/o subdevice is always initialized due to the 'if (1)'.
Simplify the attach by removing the test.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jun 26, 2012
1 parent 5c416ef commit f87a7e5
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions drivers/staging/comedi/drivers/cb_das16_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -513,17 +513,13 @@ static int das16cs_attach(struct comedi_device *dev,

s = dev->subdevices + 2;
/* digital i/o subdevice */
if (1) {
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = das16cs_dio_insn_bits;
s->insn_config = das16cs_dio_insn_config;
} else {
s->type = COMEDI_SUBD_UNUSED;
}
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 8;
s->maxdata = 1;
s->range_table = &range_digital;
s->insn_bits = das16cs_dio_insn_bits;
s->insn_config = das16cs_dio_insn_config;

return 1;
}
Expand Down

0 comments on commit f87a7e5

Please sign in to comment.