staging: comedi: das16: remove an unnecessary check in the attach
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 29 Jul 2013 21:07:30 +0000 (14:07 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Aug 2013 00:38:09 +0000 (17:38 -0700)
If the user does not specify the analog output range the private data
'user_ao_range_table' will not be allocated. The comedi core will detect
the NULL s->range_table and automatically set it to &range_unknown.

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>
drivers/staging/comedi/drivers/das16.c

index 9944f715b5daf39785bd64510e1d39caae153106..00ecb3c010d76f6b43ebcd1376835fba1e9719c9 100644 (file)
@@ -1148,11 +1148,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                s->subdev_flags = SDF_WRITABLE;
                s->n_chan       = 2;
                s->maxdata      = 0x0fff;
-               if (devpriv->user_ao_range_table)
-                       s->range_table  = devpriv->user_ao_range_table;
-               else
-                       s->range_table  = &range_unknown;
-
+               s->range_table  = devpriv->user_ao_range_table;
                s->insn_write   = das16_ao_insn_write;
        } else {
                s->type         = COMEDI_SUBD_UNUSED;