staging: comedi: propogate error code from comedi_alloc_subdevices
[deliverable/linux.git] / drivers / staging / comedi / drivers / adq12b.c
index afc6815bcc362abd4856562257d4005e794ed8b0..f7bb14589c9bd7865c4b5e8983111e25bc1ac808 100644 (file)
@@ -224,6 +224,7 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct comedi_subdevice *s;
        unsigned long iobase;
        int unipolar, differential;
+       int ret;
 
        iobase = it->options[0];
        unipolar = it->options[1];
@@ -267,8 +268,9 @@ static int adq12b_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        devpriv->last_channel = -1;
        devpriv->last_range = -1;
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 3);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* analog input subdevice */
This page took 0.026244 seconds and 5 git commands to generate.