staging: comedi: cb_das16_cs: cleanup dio subdevice initialization
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 26 Jun 2012 00:00:19 +0000 (17:00 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Jun 2012 22:30:52 +0000 (15:30 -0700)
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>
drivers/staging/comedi/drivers/cb_das16_cs.c

index b0a2223569a3595f38645147c0dffa5ab710ba96..f3d5ca00f14771431e46fa6a7c4efd474c4c7e41 100644 (file)
@@ -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;
 }