staging: comedi: propogate error code from comedi_alloc_subdevices
[deliverable/linux.git] / drivers / staging / comedi / drivers / ni_at_ao.c
index 03a4d736b454f43d96098bdfdd6c3072a1a85669..1c3f3222d4967886bec2985b4c97c22fd76e3ed9 100644 (file)
@@ -337,6 +337,7 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct comedi_subdevice *s;
        unsigned long iobase;
        int ao_unipolar;
+       int ret;
 
        iobase = it->options[0];
        if (iobase == 0)
@@ -356,8 +357,9 @@ static int atao_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (alloc_private(dev, sizeof(struct atao_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 4);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* analog output subdevice */
This page took 0.029675 seconds and 5 git commands to generate.