staging: comedi: propogate error code from comedi_alloc_subdevices
[deliverable/linux.git] / drivers / staging / comedi / drivers / pcl725.c
index d7ba336ce031652ea0086977e6da9fc5809fa7bf..8edbefd7c43b5d58ac054b8c5a65ca73140556a8 100644 (file)
@@ -52,6 +52,7 @@ static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        struct comedi_subdevice *s;
        unsigned long iobase;
+       int ret;
 
        iobase = it->options[0];
        printk(KERN_INFO "comedi%d: pcl725: 0x%04lx ", dev->minor, iobase);
@@ -63,8 +64,9 @@ static int pcl725_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->iobase = iobase;
        dev->irq = 0;
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* do */
This page took 0.028172 seconds and 5 git commands to generate.