staging: comedi: propogate error code from comedi_alloc_subdevices
[deliverable/linux.git] / drivers / staging / comedi / drivers / fl512.c
index 7218a9b2cda93395d1215c19dc159b3c06afce6b..d1da80976f84767578084308eca18f69f8927fa1 100644 (file)
@@ -111,6 +111,7 @@ static int fl512_ao_insn_readback(struct comedi_device *dev,
 static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        unsigned long iobase;
+       int ret;
 
        /* pointer to the subdevice: Analog in, Analog out,
           (not made ->and Digital IO) */
@@ -131,8 +132,9 @@ static int fl512_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        printk(KERN_DEBUG "malloc ok\n");
 #endif
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2);
+       if (ret)
+               return ret;
 
        /*
         * this if the definitions of the supdevices, 2 have been defined
This page took 0.02434 seconds and 5 git commands to generate.