staging: comedi: propogate error code from comedi_alloc_subdevices
authorH Hartley Sweeten <hartleys@visionengravers.com>
Tue, 12 Jun 2012 18:59:33 +0000 (11:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Jun 2012 21:44:04 +0000 (14:44 -0700)
comedi_alloc_subdevices can fail with -EINVAL or -ENOMEM. When it
does fail make sure to pass the proper error code back.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ian Abbott <abbott@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
103 files changed:
drivers/staging/comedi/drivers/8255.c
drivers/staging/comedi/drivers/acl7225b.c
drivers/staging/comedi/drivers/addi-data/addi_common.c
drivers/staging/comedi/drivers/addi-data/hwdrv_APCI1710.c
drivers/staging/comedi/drivers/adl_pci6208.c
drivers/staging/comedi/drivers/adl_pci7230.c
drivers/staging/comedi/drivers/adl_pci7296.c
drivers/staging/comedi/drivers/adl_pci7432.c
drivers/staging/comedi/drivers/adl_pci8164.c
drivers/staging/comedi/drivers/adl_pci9111.c
drivers/staging/comedi/drivers/adl_pci9118.c
drivers/staging/comedi/drivers/adq12b.c
drivers/staging/comedi/drivers/adv_pci1710.c
drivers/staging/comedi/drivers/adv_pci1723.c
drivers/staging/comedi/drivers/adv_pci_dio.c
drivers/staging/comedi/drivers/aio_aio12_8.c
drivers/staging/comedi/drivers/aio_iiro_16.c
drivers/staging/comedi/drivers/amplc_dio200.c
drivers/staging/comedi/drivers/amplc_pc236.c
drivers/staging/comedi/drivers/amplc_pc263.c
drivers/staging/comedi/drivers/amplc_pci224.c
drivers/staging/comedi/drivers/amplc_pci230.c
drivers/staging/comedi/drivers/c6xdigio.c
drivers/staging/comedi/drivers/cb_das16_cs.c
drivers/staging/comedi/drivers/cb_pcidas.c
drivers/staging/comedi/drivers/cb_pcidas64.c
drivers/staging/comedi/drivers/cb_pcidda.c
drivers/staging/comedi/drivers/cb_pcidio.c
drivers/staging/comedi/drivers/cb_pcimdas.c
drivers/staging/comedi/drivers/cb_pcimdda.c
drivers/staging/comedi/drivers/comedi_bond.c
drivers/staging/comedi/drivers/comedi_parport.c
drivers/staging/comedi/drivers/comedi_test.c
drivers/staging/comedi/drivers/contec_pci_dio.c
drivers/staging/comedi/drivers/daqboard2000.c
drivers/staging/comedi/drivers/das08.c
drivers/staging/comedi/drivers/das16.c
drivers/staging/comedi/drivers/das16m1.c
drivers/staging/comedi/drivers/das1800.c
drivers/staging/comedi/drivers/das6402.c
drivers/staging/comedi/drivers/das800.c
drivers/staging/comedi/drivers/dmm32at.c
drivers/staging/comedi/drivers/dt2801.c
drivers/staging/comedi/drivers/dt2811.c
drivers/staging/comedi/drivers/dt2814.c
drivers/staging/comedi/drivers/dt2815.c
drivers/staging/comedi/drivers/dt2817.c
drivers/staging/comedi/drivers/dt282x.c
drivers/staging/comedi/drivers/dt3000.c
drivers/staging/comedi/drivers/dt9812.c
drivers/staging/comedi/drivers/dyna_pci10xx.c
drivers/staging/comedi/drivers/fl512.c
drivers/staging/comedi/drivers/gsc_hpdi.c
drivers/staging/comedi/drivers/icp_multi.c
drivers/staging/comedi/drivers/ii_pci20kc.c
drivers/staging/comedi/drivers/jr3_pci.c
drivers/staging/comedi/drivers/ke_counter.c
drivers/staging/comedi/drivers/me4000.c
drivers/staging/comedi/drivers/me_daq.c
drivers/staging/comedi/drivers/mpc624.c
drivers/staging/comedi/drivers/mpc8260cpm.c
drivers/staging/comedi/drivers/multiq3.c
drivers/staging/comedi/drivers/ni_6527.c
drivers/staging/comedi/drivers/ni_65xx.c
drivers/staging/comedi/drivers/ni_660x.c
drivers/staging/comedi/drivers/ni_670x.c
drivers/staging/comedi/drivers/ni_at_a2150.c
drivers/staging/comedi/drivers/ni_at_ao.c
drivers/staging/comedi/drivers/ni_atmio16d.c
drivers/staging/comedi/drivers/ni_daq_700.c
drivers/staging/comedi/drivers/ni_daq_dio24.c
drivers/staging/comedi/drivers/ni_labpc.c
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_pcidio.c
drivers/staging/comedi/drivers/pcl711.c
drivers/staging/comedi/drivers/pcl724.c
drivers/staging/comedi/drivers/pcl725.c
drivers/staging/comedi/drivers/pcl726.c
drivers/staging/comedi/drivers/pcl730.c
drivers/staging/comedi/drivers/pcl812.c
drivers/staging/comedi/drivers/pcl816.c
drivers/staging/comedi/drivers/pcl818.c
drivers/staging/comedi/drivers/pcm3724.c
drivers/staging/comedi/drivers/pcm3730.c
drivers/staging/comedi/drivers/pcmad.c
drivers/staging/comedi/drivers/pcmda12.c
drivers/staging/comedi/drivers/pcmmio.c
drivers/staging/comedi/drivers/pcmuio.c
drivers/staging/comedi/drivers/poc.c
drivers/staging/comedi/drivers/quatech_daqp_cs.c
drivers/staging/comedi/drivers/rtd520.c
drivers/staging/comedi/drivers/rti800.c
drivers/staging/comedi/drivers/rti802.c
drivers/staging/comedi/drivers/s526.c
drivers/staging/comedi/drivers/s626.c
drivers/staging/comedi/drivers/serial2002.c
drivers/staging/comedi/drivers/skel.c
drivers/staging/comedi/drivers/ssv_dnp.c
drivers/staging/comedi/drivers/unioxx5.c
drivers/staging/comedi/drivers/usbdux.c
drivers/staging/comedi/drivers/usbduxfast.c
drivers/staging/comedi/drivers/usbduxsigma.c
drivers/staging/comedi/drivers/vmk80xx.c

index 64b00547228bef85eb4616efdcbc494bc0d037ed..502bde8c22c1556abf526c3a7b9f0e115fb3e151 100644 (file)
@@ -389,7 +389,7 @@ static int dev_8255_attach(struct comedi_device *dev,
        }
 
        ret = comedi_alloc_subdevices(dev, i);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        printk(KERN_INFO "comedi%d: 8255:", dev->minor);
index 3c39148c64cb5d0ea79237958132b946e2ef0d98..0bf552581c5fd584e97fb94f2e4777cbd26fc37d 100644 (file)
@@ -68,6 +68,7 @@ static int acl7225b_attach(struct comedi_device *dev,
        const struct boardtype *board = comedi_board(dev);
        struct comedi_subdevice *s;
        int iobase, iorange;
+       int ret;
 
        iobase = it->options[0];
        iorange = board->io_range;
@@ -82,8 +83,9 @@ static int acl7225b_attach(struct comedi_device *dev,
        dev->iobase = iobase;
        dev->irq = 0;
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 3);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* Relays outputs */
index 46c590b1ad96036e6bd32e6984e2b818ca6ef5fc..a5aa673335efdf775122816831fcf887a62bed66 100644 (file)
@@ -1688,7 +1688,7 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
        } else {
                n_subdevices = 7;
                ret = comedi_alloc_subdevices(dev, n_subdevices);
-               if (ret < 0)
+               if (ret)
                        return ret;
 
                /*  Allocate and Initialise AI Subdevice Structures */
index aa390b01475bce69b2ea7eade14646c36583f5ba..595238feaf42b9f88871ee495ec7af7e21d12312 100644 (file)
@@ -63,7 +63,7 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
        int n_subdevices = 9;
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0)
+       if (ret)
                return;
 
        /*  Allocate and Initialise Timer Subdevice Structures */
index 7d26d45d07538e1743f645fe0ce2ad6a2a98e0aa..98b373063445d13004a1057c0d29fd10b0129d6b 100644 (file)
@@ -301,8 +301,9 @@ static int pci6208_attach(struct comedi_device *dev,
        dev->iobase = io_base;
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       retval = comedi_alloc_subdevices(dev, 2);
+       if (retval)
+               return retval;
 
        s = dev->subdevices + 0;
        /* analog output subdevice */
index 5a6e6c11e7fee89163be855c75e6a4bcd8966b2a..62fdf7f63703d27199bcee4ce0ce4811b14c9552 100644 (file)
@@ -108,6 +108,7 @@ static int adl_pci7230_attach(struct comedi_device *dev,
        struct comedi_devconfig *it)
 {
        struct comedi_subdevice *s;
+       int ret;
 
        printk(KERN_INFO "comedi%d: adl_pci7230\n", dev->minor);
 
@@ -116,8 +117,9 @@ static int adl_pci7230_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct adl_pci7230_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2);
+       if (ret)
+               return ret;
 
        devpriv->pci_dev = adl_pci7230_find_pci(dev, it);
        if (!devpriv->pci_dev)
index fd9b33afd45807c12500fbea4c35ee9e93d371db..58deb60f2b8c10b9b1583f38b6b91d2234370314 100644 (file)
@@ -92,8 +92,9 @@ static int adl_pci7296_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct adl_pci7296_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 4);
+       if (ret)
+               return ret;
 
        devpriv->pci_dev = adl_pci7296_find_pci(dev, it);
        if (!devpriv->pci_dev)
index 4976a70fb1e4b93319d389301837218b565b3513..aabf4183aaf5c403a41b373994e667a0c5459ff8 100644 (file)
@@ -117,6 +117,7 @@ static int adl_pci7432_attach(struct comedi_device *dev,
                              struct comedi_devconfig *it)
 {
        struct comedi_subdevice *s;
+       int ret;
 
        printk(KERN_INFO "comedi%d: attach adl_pci7432\n", dev->minor);
 
@@ -125,8 +126,9 @@ static int adl_pci7432_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct adl_pci7432_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2);
+       if (ret)
+               return ret;
 
        devpriv->pci_dev = adl_pci7432_find_pci(dev, it);
        if (!devpriv->pci_dev)
index 78169f7d06ac4d47e93eace32701f6b174ef2cea..181137546133e2d23d7c27dd19e71a5c4f028e04 100644 (file)
@@ -252,6 +252,7 @@ static int adl_pci8164_attach(struct comedi_device *dev,
                              struct comedi_devconfig *it)
 {
        struct comedi_subdevice *s;
+       int ret;
 
        printk(KERN_INFO "comedi: attempt to attach...\n");
        printk(KERN_INFO "comedi%d: adl_pci8164\n", dev->minor);
@@ -261,8 +262,9 @@ static int adl_pci8164_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct adl_pci8164_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 4);
+       if (ret)
+               return ret;
 
        devpriv->pci_dev = adl_pci8164_find_pci(dev, it);
        if (!devpriv->pci_dev)
index cc179466dce00d4316fc326b18bdb27b8bcf1e1f..4f2cea8e11f789a8e2700db2504022d3cec11caa 100644 (file)
@@ -1318,7 +1318,7 @@ static int pci9111_attach(struct comedi_device *dev,
        /*  TODO: Add external multiplexer setup (according to option[2]). */
 
        error = comedi_alloc_subdevices(dev, 4);
-       if (error < 0)
+       if (error)
                return error;
 
        subdevice = dev->subdevices + 0;
index ebd8b8ec8c31ff993c0e225c81233f7607d21197..9a7b6a5797bb7379185a78c8019d78fd43f04106 100644 (file)
@@ -2269,7 +2269,7 @@ static int pci9118_attach(struct comedi_device *dev,
                                /* Enable parity check for parity error */
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
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 */
index be3fc4dd885968e65cabd3acff5e6361a4d715c5..60a50adcd71549b433b136987d98581f8aaaeb6a 100644 (file)
@@ -1434,7 +1434,7 @@ static int pci1710_attach(struct comedi_device *dev,
                n_subdevices++;
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        pci1710_reset(dev);
index c14ad35cb835834a993284a443079e74c8f17eb5..d37c14da5ec60e37fded37bef243e041eeb984c1 100644 (file)
@@ -366,7 +366,7 @@ static int pci1723_attach(struct comedi_device *dev,
                n_subdevices++;
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        pci1723_reset(dev);
index 0fc4f858acca5bc779f00bcb2d40b63ee2c4c699..942dc777a0e65866abc56134461991fac555f187 100644 (file)
@@ -1157,7 +1157,7 @@ static int pci_dio_attach(struct comedi_device *dev,
        }
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        subdev = 0;
index 60466c81e2a9e49e05624cae4ee061ca631b3ddb..f7d453f8fe33758e44fbf1420ceb7121eedc0543 100644 (file)
@@ -168,6 +168,7 @@ static int aio_aio12_8_attach(struct comedi_device *dev,
        const struct aio12_8_boardtype *board = comedi_board(dev);
        int iobase;
        struct comedi_subdevice *s;
+       int ret;
 
        iobase = it->options[0];
        if (!request_region(iobase, 24, "aio_aio12_8")) {
@@ -182,8 +183,9 @@ static int aio_aio12_8_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct aio12_8_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 3);
+       if (ret)
+               return ret;
 
        s = &dev->subdevices[0];
        s->type = COMEDI_SUBD_AI;
index 7d161d6739ae38bcd3523820df1efcacf0dbd9c2..8059cefe5b8c466a955b9ef83c20e30ee561203b 100644 (file)
@@ -107,6 +107,7 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
        const struct aio_iiro_16_board *board = comedi_board(dev);
        int iobase;
        struct comedi_subdevice *s;
+       int ret;
 
        printk(KERN_INFO "comedi%d: aio_iiro_16: ", dev->minor);
 
@@ -124,8 +125,9 @@ static int aio_iiro_16_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct aio_iiro_16_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        s->type = COMEDI_SUBD_DIO;
index 17d3489b7f98fea940298abdd265db0f5730d049..c67b09ff37d7c46c3d9495486f86e40cafd8db0f 100644 (file)
@@ -1273,9 +1273,11 @@ static int dio200_common_attach(struct comedi_device *dev, unsigned long iobase,
        devpriv->intr_sd = -1;
        dev->iobase = iobase;
        dev->board_name = thisboard->name;
+
        ret = comedi_alloc_subdevices(dev, layout->n_subdevs);
-       if (ret < 0)
+       if (ret)
                return ret;
+
        for (n = 0; n < dev->n_subdevices; n++) {
                s = &dev->subdevices[n];
                switch (layout->sdtype[n]) {
index 6205985806f5e208778176c2fe76d5296078cebb..e55321ec5ae8e43d07f8da4976e017de0ee60089 100644 (file)
@@ -456,7 +456,7 @@ static int pc236_common_attach(struct comedi_device *dev, unsigned long iobase,
        dev->iobase = iobase;
 
        ret = comedi_alloc_subdevices(dev, 2);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index f1d68dff1ab05d7efa7bebe62121d4e08dfc80e2..4f15bfd80719e2a6a2249a3f90c12732232ee07b 100644 (file)
@@ -228,7 +228,7 @@ static int pc263_common_attach(struct comedi_device *dev, unsigned long iobase)
        dev->iobase = iobase;
 
        ret = comedi_alloc_subdevices(dev, 1);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index 1392406d99f08f3a106c7198834fedaf52406e08..b87e10ddf239b61af6ea8df7f5507aa34cc33fb3 100644 (file)
@@ -1380,7 +1380,7 @@ static int pci224_attach_common(struct comedi_device *dev,
             dev->iobase + PCI224_DACCON);
 
        ret = comedi_alloc_subdevices(dev, 1);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index 52f3cb8fb2d1bd1e7995642dbbdfab5387a2c39b..3d7f2cda980a207108252fa8f8dbb9e7a64988af 100644 (file)
@@ -2840,8 +2840,10 @@ static int pci230_attach_common(struct comedi_device *dev,
                        devpriv->pci_dev->irq);
        }
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       rc = comedi_alloc_subdevices(dev, 3);
+       if (rc)
+               return rc;
+
        s = dev->subdevices + 0;
        /* analog input subdevice */
        s->type = COMEDI_SUBD_AI;
index 5fa344b269fdeaa0bbebbfcbc96a72949ed7503c..41ed8576f301c68df6bde4dab8fc157642e684d7 100644 (file)
@@ -434,7 +434,7 @@ static int c6xdigio_attach(struct comedi_device *dev,
        dev->board_name = "c6xdigio";
 
        result = comedi_alloc_subdevices(dev, 2);
-       if (result < 0)
+       if (result)
                return result;
 
        /*  Make sure that PnP ports get activated */
index 9aa11c15497fbe8da3e5f4bd47234b6f77b25205..031007791d29770dcab9db8294b9b662fdccad26 100644 (file)
@@ -195,8 +195,9 @@ static int das16cs_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct das16cs_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;
        dev->read_subdev = s;
index e1bd99a950e43f253d950eca5b3c6e03edf91cf8..2ca3fa0fc776e37b3ee5ea9c493a3d3690d61de2 100644 (file)
@@ -533,6 +533,7 @@ static int cb_pcidas_attach(struct comedi_device *dev,
        struct pci_dev *pcidev = NULL;
        int index;
        int i;
+       int ret;
 
 /*
  * Allocate the private structure area.
@@ -614,8 +615,9 @@ found:
        /* Initialize dev->board_name */
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 7) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 7);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* analog input subdevice */
index 6b2f153980a98330614903bdae9fc46850f20a84..3aab75b5217d77cf1ee78f242b860398fbab9f6c 100644 (file)
@@ -1344,9 +1344,11 @@ static int setup_subdevices(struct comedi_device *dev)
        struct comedi_subdevice *s;
        void __iomem *dio_8255_iobase;
        int i;
+       int ret;
 
-       if (comedi_alloc_subdevices(dev, 10) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 10);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* analog input subdevice */
index fedaf55af03dbedc4b1ce1430d7f962966ae4f12..0572dc6fd5ca892069331bf0b898b2da8b75c527 100644 (file)
@@ -265,7 +265,7 @@ static int cb_pcidda_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        struct pci_dev *pcidev = NULL;
        int index;
-
+       int ret;
 
 /*
  * Allocate the private structure area.
@@ -333,8 +333,9 @@ found:
  */
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 3);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* analog output subdevice */
index f2fff4f2080bfd1a51a54e5416c957947f8a08f0..0186737c1ee17e018458d560b051762cbc7e773f 100644 (file)
@@ -116,6 +116,7 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct pci_dev *pcidev = NULL;
        int index;
        int i;
+       int ret;
 
 /*
  * Allocate the private structure area.  alloc_private() is a
@@ -177,8 +178,9 @@ found:
            pci_resource_start(devpriv->pci_dev,
                               pcidio_boards[index].dioregs_badrindex);
 
-       if (comedi_alloc_subdevices(dev, thisboard->n_8255) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, thisboard->n_8255);
+       if (ret)
+               return ret;
 
        for (i = 0; i < thisboard->n_8255; i++) {
                subdev_8255_init(dev, dev->subdevices + i,
index 0ada8b91b315ebbb53fb21ea9e8d454cbc38e86e..b99a451bab9e9b73b068b14f370756fb2290c893 100644 (file)
@@ -187,6 +187,7 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
        struct comedi_subdevice *s;
        struct pci_dev *pcidev = NULL;
        int index;
+       int ret;
        /* int i; */
 
 /*
@@ -269,8 +270,9 @@ found:
        /* Initialize dev->board_name */
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 3);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* dev->read_subdev=s; */
index b401aec893487cafc3e7688d20e48f624ccfe49d..a80146133c04dd476ef5d52a1de0971a1d4dabf3 100644 (file)
@@ -236,8 +236,9 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
  */
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       err = comedi_alloc_subdevices(dev, 2);
+       if (err)
+               return err;
 
        s = dev->subdevices + 0;
 
index 96e5b35f4d7c468451c4c2c8318b4e14224dc788..0260ddc0564530cd46c832d7c728a38867fe0514 100644 (file)
@@ -336,6 +336,7 @@ static int bonding_attach(struct comedi_device *dev,
                          struct comedi_devconfig *it)
 {
        struct comedi_subdevice *s;
+       int ret;
 
        LOG_MSG("comedi%d\n", dev->minor);
 
@@ -358,8 +359,9 @@ static int bonding_attach(struct comedi_device *dev,
         */
        dev->board_name = devpriv->name;
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        s->type = COMEDI_SUBD_DIO;
index c9a725fc61f29cc0c5665f194e667a61f288ad61..589d12f68067661ad2f9d304d6d4609ec2d93190 100644 (file)
@@ -316,8 +316,9 @@ static int parport_attach(struct comedi_device *dev,
        dev->board_name = "parport";
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
+
        ret = alloc_private(dev, sizeof(struct parport_private));
        if (ret < 0)
                return ret;
index 004da30d7d2b5e55d9adc3b79084a32efa1a53de..523a809708b7d2e6dc2b68665dc37405b65b556b 100644 (file)
@@ -432,6 +432,7 @@ static int waveform_attach(struct comedi_device *dev,
        int amplitude = it->options[0];
        int period = it->options[1];
        int i;
+       int ret;
 
        dev->board_name = board->name;
 
@@ -447,8 +448,9 @@ static int waveform_attach(struct comedi_device *dev,
        devpriv->uvolt_amplitude = amplitude;
        devpriv->usec_period = period;
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        dev->read_subdev = s;
index a5bad1bd6dcd172c04850bfe9a1542ab54d11fdf..79854b1ac243eae560437357e554f1fc52aee0f4 100644 (file)
@@ -107,6 +107,7 @@ static int contec_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        struct pci_dev *pcidev = NULL;
        struct comedi_subdevice *s;
+       int ret;
 
        printk("comedi%d: contec: ", dev->minor);
 
@@ -115,8 +116,9 @@ static int contec_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (alloc_private(dev, sizeof(struct contec_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2);
+       if (ret)
+               return ret;
 
        for_each_pci_dev(pcidev) {
                if (pcidev->vendor == PCI_VENDOR_ID_CONTEC &&
index dbd0472bc7e2daeea346af8d5daaf1bb5d71d037..9ecf1a46856767a75e29de2d8187d33b38ded7d6 100644 (file)
@@ -773,8 +773,8 @@ static int daqboard2000_attach(struct comedi_device *dev,
                return -ENOMEM;
 
        result = comedi_alloc_subdevices(dev, 3);
-       if (result < 0)
-               goto out;
+       if (result)
+               return result;
 
        readl(devpriv->plx + 0x6c);
 
index 1dea21a33a273c347e04c01eabf707860a1bcd91..c4627a6b62befb4498bf1c7e73cd8b98b3a64c47 100644 (file)
@@ -835,7 +835,7 @@ int das08_common_attach(struct comedi_device *dev, unsigned long iobase)
        dev->board_name = thisboard->name;
 
        ret = comedi_alloc_subdevices(dev, 6);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index 6a8a7eb1ae9c087009f1db23eb1774bce5b8ab43..0c6ad1067055d61dc2b36d4667e1194fa2325393 100644 (file)
@@ -1265,7 +1265,7 @@ static int das16_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        devpriv->timer_mode = timer_mode ? 1 : 0;
 
        ret = comedi_alloc_subdevices(dev, 5);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index eafd6b59a483663e90f446fd7a0dc66905a6d162..f3fba13432bb258195b20909288838d2adb08988 100644 (file)
@@ -647,7 +647,7 @@ static int das16m1_attach(struct comedi_device *dev,
        }
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index 12d736a6e38df6202bf6aae7aa0389b29747bde5..af60e5d5b8a3d441d1d8ef3fe397ab98a820f0ab 100644 (file)
@@ -1644,8 +1644,9 @@ static int das1800_attach(struct comedi_device *dev,
                        return -ENOMEM;
        }
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
+       retval = comedi_alloc_subdevices(dev, 4);
+       if (retval)
+               return retval;
 
        /* analog input subdevice */
        s = dev->subdevices + 0;
index 2039b6c11590d2108aeba2468ca082eaee8d2dbc..22a9b3448e3fb82c5ec86185ea03345bf5ba4ef5 100644 (file)
@@ -308,7 +308,7 @@ static int das6402_attach(struct comedi_device *dev,
                return ret;
 
        ret = comedi_alloc_subdevices(dev, 1);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        /* ai subdevice */
index 6263f532e5da22a80702e1b617829ec2a9596b19..81698b1fd0dac5621536df1225a45a5a606954f0 100644 (file)
@@ -465,6 +465,7 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        unsigned int irq = it->options[1];
        unsigned long irq_flags;
        int board;
+       int ret;
 
        dev_info(dev->hw_dev, "comedi%d: das800: io 0x%lx\n", dev->minor,
                 iobase);
@@ -510,8 +511,9 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 3);
+       if (ret)
+               return ret;
 
        /* analog input subdevice */
        s = dev->subdevices + 0;
index 6b637a2a48c70552ca87daa565ad8c55d2e1b54c..2b60cf816b6e36ffff0aa1f17a52cf71d64e2e03 100644 (file)
@@ -371,8 +371,9 @@ static int dmm32at_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct dmm32at_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 3);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        dev->read_subdev = s;
index 35ce076237a47a205ca48c2cbfef5fad5879f00d..5afbf8a4b030c2817f4a402893d31d30f65676bc 100644 (file)
@@ -626,15 +626,15 @@ havetype:
        printk("dt2801: %s at port 0x%lx", boardtype.name, iobase);
 
        n_ai_chans = probe_number_of_ai_chans(dev);
-       printk(" (ai channels = %d)", n_ai_chans);
+       printk(" (ai channels = %d)\n", n_ai_chans);
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                goto out;
 
        ret = alloc_private(dev, sizeof(struct dt2801_private));
        if (ret < 0)
-               goto out;
+               return ret;
 
        dev->board_name = boardtype.name;
 
@@ -688,8 +688,6 @@ havetype:
 
        ret = 0;
 out:
-       printk("\n");
-
        return ret;
 }
 
index 6ff610d1b0f9c7ef920ffc4cd1d12e905d827558..91fbf4a7a2afcf65db4e8b107dbceb0787e082dc 100644 (file)
@@ -466,7 +466,7 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 #endif
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        ret = alloc_private(dev, sizeof(struct dt2811_private));
index 876d5cbdbe4af60863b4384c10c515caa785c540..2e39ebe36fb5863ed4ca831a9435a66d5e458ebd 100644 (file)
@@ -339,7 +339,7 @@ static int dt2814_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        }
 
        ret = comedi_alloc_subdevices(dev, 1);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        ret = alloc_private(dev, sizeof(struct dt2814_private));
index 33ad1fa90762df76bb46f5e3b49d0015e2b91e57..45b20bee43690ae1be9d6d7a1571c38609132b88 100644 (file)
@@ -166,6 +166,7 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        int i;
        const struct comedi_lrange *current_range_type, *voltage_range_type;
        unsigned long iobase;
+       int ret;
 
        iobase = it->options[0];
        printk(KERN_INFO "comedi%d: dt2815: 0x%04lx ", dev->minor, iobase);
@@ -177,8 +178,10 @@ static int dt2815_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->iobase = iobase;
        dev->board_name = "dt2815";
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
+
        if (alloc_private(dev, sizeof(struct dt2815_private)) < 0)
                return -ENOMEM;
 
index 665db07aeb8480477988f81c552d4479421eda11..9282ca55f6374498eb2c54f3f11f0c7eff1733a1 100644 (file)
@@ -138,7 +138,7 @@ static int dt2817_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->board_name = "dt2817";
 
        ret = comedi_alloc_subdevices(dev, 1);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index f11d1fdfcae2a29e69a250f7cdbd7cae20f6b321..9c0a0df7dff2e0a715e4c608d12673a9f47cfbe0 100644 (file)
@@ -1269,7 +1269,7 @@ static int dt282x_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                return ret;
 
        ret = comedi_alloc_subdevices(dev, 3);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index 10415b218b5c7bbfe7e3ffdf319565efe9e58b94..9828fb1e3365ab8b4aeeec44e702b529ba2f50e6 100644 (file)
@@ -883,7 +883,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->irq = devpriv->pci_dev->irq;
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices;
index 678fa502a716795ed35256130aedd2a1adcf760a..40821c7303ea5618327bed518f2882776e1a9417 100644 (file)
@@ -1021,6 +1021,7 @@ static int dt9812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        int i;
        struct comedi_subdevice *s;
+       int ret;
 
        dev->board_name = "dt9812";
 
@@ -1035,8 +1036,9 @@ static int dt9812_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        devpriv->serial = it->options[0];
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 4);
+       if (ret)
+               return ret;
 
        /* digital input subdevice */
        s = dev->subdevices + 0;
index bab2e37967ed2092aae75aa6cc38fd7bb254b759..9c855e25275caf07758e642086a16d05a58ebc0e 100644 (file)
@@ -246,6 +246,7 @@ static int dyna_pci10xx_attach(struct comedi_device *dev,
        struct pci_dev *pcidev;
        unsigned int opt_bus, opt_slot;
        int board_index, i;
+       int ret;
 
        mutex_lock(&start_stop_sem);
 
@@ -329,9 +330,10 @@ found:
        devpriv->BADR4 = pci_resource_start(pcidev, 4);
        devpriv->BADR5 = pci_resource_start(pcidev, 5);
 
-       if (comedi_alloc_subdevices(dev, 4) < 0) {
+       ret = comedi_alloc_subdevices(dev, 4);
+       if (ret) {
                mutex_unlock(&start_stop_sem);
-               return -ENOMEM;
+               return ret;
        }
 
        /* analog input */
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
index b103cfbf32746687dcf9439e1b4b0c774970364c..79f580841dee3e68dddcbccf8eaa0236f3444d12 100644 (file)
@@ -430,9 +430,11 @@ static void init_plx9080(struct comedi_device *dev)
 static int setup_subdevices(struct comedi_device *dev)
 {
        struct comedi_subdevice *s;
+       int ret;
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* analog input subdevice */
index 06c66afc6aa1a6ca48630affe939b33330ff33f1..544bed870470badf42e32333ce7ef8807bb6beda 100644 (file)
@@ -904,7 +904,7 @@ static int icp_multi_attach(struct comedi_device *dev,
                n_subdevices++;
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        icp_multi_reset(dev);
index 9c11657910788f93cfa4da452187c95bfa08ea1f..bea3d03bae2e890d6ea86a12881c76d71642f667 100644 (file)
@@ -203,7 +203,7 @@ static int pci20xxx_attach(struct comedi_device *dev,
        union pci20xxx_subdev_private *sdp;
 
        ret = comedi_alloc_subdevices(dev, 1 + PCI20000_MODULES);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        ret = alloc_private(dev, sizeof(struct pci20xxx_private));
index 182643bed561b2b4696f179d93257d8be3704e9f..3c043e5355066172f2ce7cbf6699cd35b4ba7b55 100644 (file)
@@ -827,8 +827,8 @@ static int jr3_pci_attach(struct comedi_device *dev,
                return -ENOMEM;
 
        result = comedi_alloc_subdevices(dev, devpriv->n_channels);
-       if (result < 0)
-               goto out;
+       if (result)
+               return result;
 
        dev->open = jr3_pci_open;
        for (i = 0; i < devpriv->n_channels; i++) {
index 7c256f4f32d12a4f2b78e64a32e1ff796c323d5b..019e91a9f14335583e8d7eff78bebd45710fe509 100644 (file)
@@ -190,7 +190,7 @@ found:
        dev->iobase = io_base;
 
        error = comedi_alloc_subdevices(dev, 1);
-       if (error < 0)
+       if (error)
                return error;
 
        subdevice = dev->subdevices + 0;
index 4adb206ebd933618053e811ea7756599a65c10ef..aae01f10b1c3c5527a4ca604db5e939e7606c1d7 100644 (file)
@@ -2190,8 +2190,9 @@ static int me4000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (result)
                return result;
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
+       result = comedi_alloc_subdevices(dev, 4);
+       if (result)
+               return result;
 
     /*=========================================================================
       Analog input subdevice
index 231b29413eaab38753f1416da21430baeb0dcacc..ae3b0469541ebc5f21267b4fa613d5624d66b683 100644 (file)
@@ -761,9 +761,8 @@ found:
 
        me_reset(dev);
 
-       /* device driver capabilities */
        error = comedi_alloc_subdevices(dev, 3);
-       if (error < 0)
+       if (error)
                return error;
 
        subdevice = dev->subdevices + 0;
index 975033653f0ccf7567b2cf391804d5b14cd43e52..b928b6763cd5fd669d9145865f95c1a1b0b927d0 100644 (file)
@@ -285,6 +285,7 @@ static int mpc624_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: mpc624 [0x%04lx, ", dev->minor, iobase);
@@ -348,8 +349,9 @@ static int mpc624_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                devpriv->ulConvertionRate = MPC624_SPEED_3_52_kHz;
        }
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        s->type = COMEDI_SUBD_AI;
index 13110510d7fe449e64a10079387e8f2af3b914e5..a6311b11831beba9777093d0bb36e55a2b4ab70d 100644 (file)
@@ -121,6 +121,7 @@ static int mpc8260cpm_attach(struct comedi_device *dev,
 {
        struct comedi_subdevice *s;
        int i;
+       int ret;
 
        printk("comedi%d: mpc8260cpm: ", dev->minor);
 
@@ -131,8 +132,9 @@ static int mpc8260cpm_attach(struct comedi_device *dev,
        if (alloc_private(dev, sizeof(struct mpc8260cpm_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
+       ret =comedi_alloc_subdevices(dev, 4);
+       if (ret)
+               return ret;
 
        for (i = 0; i < 4; i++) {
                s = dev->subdevices + i;
index 00d497c270aebc785486626f77e50edd67dc25ed..b1bbd0255fbc213855242291b20a69dd389222b5 100644 (file)
@@ -255,8 +255,9 @@ static int multiq3_attach(struct comedi_device *dev,
        else
                printk(KERN_WARNING "comedi%d: no irq\n", dev->minor);
        dev->board_name = "multiq3";
+
        result = comedi_alloc_subdevices(dev, 5);
-       if (result < 0)
+       if (result)
                return result;
 
        result = alloc_private(dev, sizeof(struct multiq3_private));
index 89fee6fdcf6123f79db35d2100aad77ba5996485..b60ab4848b64279991c2568db4a80ddf7a5a7772 100644 (file)
@@ -398,7 +398,7 @@ static int ni6527_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                readb(devpriv->mite->daq_io_addr + ID_Register));
 
        ret = comedi_alloc_subdevices(dev, 3);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index a49dceac65bca641a20913d08f3835d2c2291d3a..ac7c74be08a200a4eb2ecbe4c73da4e932caa8d7 100644 (file)
@@ -679,7 +679,7 @@ static int ni_65xx_attach(struct comedi_device *dev,
               readb(private(dev)->mite->daq_io_addr + ID_Register));
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index 8c6a6ba9d4b9b2cfd92ea627c4c5fca2383f094d..5391a3949da125fce868dc6e43f3690d20042680 100644 (file)
@@ -1093,8 +1093,9 @@ static int ni_660x_attach(struct comedi_device *dev,
 
        printk(KERN_INFO " %s ", dev->board_name);
 
-       if (comedi_alloc_subdevices(dev, 2 + NI_660X_MAX_NUM_COUNTERS) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2 + NI_660X_MAX_NUM_COUNTERS);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* Old GENERAL-PURPOSE COUNTER/TIME (GPCT) subdevice, no longer used */
index 45a03e64549accbc2167e9925117b56a7eb0640a..5dffe6ce47383b56c43adc3e420c3e5592bd2988 100644 (file)
@@ -202,8 +202,9 @@ static int ni_670x_attach(struct comedi_device *dev,
        dev->irq = mite_irq(devpriv->mite);
        printk(KERN_INFO " %s", dev->board_name);
 
-       if (comedi_alloc_subdevices(dev, 2) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 2);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* analog output subdevice */
index 9d1a0f745bf880bddbe123240649a0f1e610da56..b53a4286f8cbaee8f41188de3171b0382af78bb7 100644 (file)
@@ -755,6 +755,7 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        unsigned int dma = it->options[2];
        static const int timeout = 2000;
        int i;
+       int ret;
 
        printk("comedi%d: %s: io 0x%lx", dev->minor, dev->driver->driver_name,
               iobase);
@@ -826,8 +827,9 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->board_ptr = a2150_boards + a2150_probe(dev);
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        /* analog input subdevice */
        s = dev->subdevices + 0;
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 */
index 37ff6fc8615794b7e1d824cd84982263a2c521d6..95bee84b78aec8013ef0aa681fcdff37327362ef 100644 (file)
@@ -710,7 +710,7 @@ static int atmio16d_attach(struct comedi_device *dev,
        dev->board_name = board->name;
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        ret = alloc_private(dev, sizeof(struct atmio16d_private));
index 8860207e88d7b73a7fbe6d390164735f22b75a38..53b0173aa2b2a7be09caaf5426bd2879fcb17efe 100644 (file)
@@ -364,6 +364,7 @@ static int dio700_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        unsigned int irq = 0;
 #endif
        struct pcmcia_device *link;
+       int ret;
 
        /* allocate and initialize dev->private */
        if (alloc_private(dev, sizeof(struct dio700_private)) < 0)
@@ -409,8 +410,9 @@ static int dio700_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        /* DAQCard-700 dio */
        s = dev->subdevices + 0;
index 36c0c62382ed1078ac0a1620e33730eb7d1b4810..e27cae0eb8a2021b1fa0eb4efd9ce1c840f8bf4a 100644 (file)
@@ -116,6 +116,7 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        unsigned int irq = 0;
 #endif
        struct pcmcia_device *link;
+       int ret;
 
        /* allocate and initialize dev->private */
        if (alloc_private(dev, sizeof(struct dio24_private)) < 0)
@@ -158,8 +159,9 @@ static int dio24_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        /* 8255 dio */
        s = dev->subdevices + 0;
index a92570f5a7c5b1ec7f560a1d5ad01689ed5f00e0..ab8b787c78bbe0044892a40bab3576a021283cdc 100644 (file)
@@ -536,6 +536,7 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase,
        unsigned long dma_flags;
 #endif
        short lsb, msb;
+       int ret;
 
        printk(KERN_ERR "comedi%d: ni_labpc: %s, io 0x%lx", dev->minor,
                                                                thisboard->name,
@@ -622,8 +623,9 @@ int labpc_common_attach(struct comedi_device *dev, unsigned long iobase,
 
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 5) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 5);
+       if (ret)
+               return ret;
 
        /* analog input subdevice */
        s = dev->subdevices + 0;
index 4261e929869fe05be052b3c64ab98ab39f15677d..1f796b9361b232daefd62a0f139af7facc5cc832 100644 (file)
@@ -4406,14 +4406,16 @@ static int ni_E_init(struct comedi_device *dev, struct comedi_devconfig *it)
        struct comedi_subdevice *s;
        unsigned j;
        enum ni_gpct_variant counter_variant;
+       int ret;
 
        if (boardtype.n_aochan > MAX_N_AO_CHAN) {
                printk("bug! boardtype.n_aochan > MAX_N_AO_CHAN\n");
                return -EINVAL;
        }
 
-       if (comedi_alloc_subdevices(dev, NI_NUM_SUBDEVICES) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, NI_NUM_SUBDEVICES);
+       if (ret)
+               return ret;
 
        /* analog input subdevice */
 
index 77ef312f657e1dafcdf0c0b50ec28831a96de47d..cba0459651677b2a59b9259aa232114d62575e53 100644 (file)
@@ -1249,7 +1249,7 @@ static int nidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                n_subdevices = 1;
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        if (!this_board->is_diodaq) {
index 35b95105a749185fa64b5dad34f726e06f6769fd..d5fa6f28eb1fdb77004d622a4ed8e86176a5dcc0 100644 (file)
@@ -519,7 +519,7 @@ static int pcl711_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->irq = irq;
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        ret = alloc_private(dev, sizeof(struct pcl711_private));
index 698c9004c74eca29d7f1550826cb8cf14e54d436..c8fe23ca899d71600bec4533f567cfaf550325fa 100644 (file)
@@ -157,7 +157,7 @@ static int pcl724_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                n_subdevices = 4;       /*  PCL-724 in 96 DIO configuration */
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        for (i = 0; i < dev->n_subdevices; i++) {
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 */
index e756a30337670e64cf3df67131222dba96f8f35e..b2e73cda2957b27573984e7f9d7c9da434b5ec5e 100644 (file)
@@ -293,7 +293,7 @@ static int pcl726_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        printk("\n");
 
        ret = comedi_alloc_subdevices(dev, 3);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index e258bcebf198f1e0448074fde866ef11ec566608..3cba79a219b8212248ae121a1158466f53440525 100644 (file)
@@ -72,6 +72,7 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct comedi_subdevice *s;
        unsigned long iobase;
        unsigned int iorange;
+       int ret;
 
        iobase = it->options[0];
        iorange = board->io_range;
@@ -85,8 +86,9 @@ static int pcl730_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->iobase = iobase;
        dev->irq = 0;
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 4);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* Isolated do */
index 128f5b644878d1623033adc85bb4b4789a80279d..0a4074af8a6029fab8ecb476b0ee09144375fb7e 100644 (file)
@@ -1383,7 +1383,7 @@ no_dma:
                n_subdevices++;
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0) {
+       if (ret) {
                free_resources(dev);
                return ret;
        }
index 37cedbc47a43a58893c41be55cf2ffec1cf5110f..c3ee6d69b9a6c1ad476693f8d1ee8cb9bb707811 100644 (file)
@@ -1195,7 +1195,7 @@ no_dma:
 */
 
        ret = comedi_alloc_subdevices(dev, 1);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index a4c2870562fbc305cbb648cbee7c55c8c809ad2a..66b2570fb24eb9a05827bb1f36c616a038f78c35 100644 (file)
@@ -1779,7 +1779,7 @@ no_rtc:
 no_dma:
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        s = dev->subdevices + 0;
index d755b406a6f19438c42220f43bf83e4116a585f0..62c22ccfb780fbb04413fa4ed9f8937d05161603 100644 (file)
@@ -259,7 +259,7 @@ static int pcm3724_attach(struct comedi_device *dev,
        n_subdevices = board->numofports;
 
        ret = comedi_alloc_subdevices(dev, n_subdevices);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        for (i = 0; i < dev->n_subdevices; i++) {
index 48a21bd679fd8367a4b93eeaecce884a7630c3b0..b48f7aa7520bcb95377011a024a9f02a4146ce6a 100644 (file)
@@ -59,6 +59,7 @@ static int pcm3730_attach(struct comedi_device *dev,
 {
        struct comedi_subdevice *s;
        unsigned long iobase;
+       int ret;
 
        iobase = it->options[0];
        printk(KERN_INFO "comedi%d: pcm3730: 0x%04lx ", dev->minor, iobase);
@@ -71,8 +72,9 @@ static int pcm3730_attach(struct comedi_device *dev,
        dev->iobase = dev->iobase;
        dev->irq = 0;
 
-       if (comedi_alloc_subdevices(dev, 6) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 6);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        s->type = COMEDI_SUBD_DO;
index 00b0f2a6894c5f2abbfea4d34c0e2cc0f24a45f2..54d19c943967080fb4e13e57145003def41346ce 100644 (file)
@@ -118,7 +118,7 @@ static int pcmad_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->iobase = iobase;
 
        ret = comedi_alloc_subdevices(dev, 1);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        ret = alloc_private(dev, sizeof(struct pcmad_priv_struct));
index 87faa03819769d0415edc3df25d7b3dca5e11cd7..291ce7c1bdb198fd69131933bc57ae1c7dfea9b1 100644 (file)
@@ -165,6 +165,7 @@ static int pcmda12_attach(struct comedi_device *dev,
        const struct pcmda12_board *board = comedi_board(dev);
        struct comedi_subdevice *s;
        unsigned long iobase;
+       int ret;
 
        iobase = it->options[0];
        printk(KERN_INFO
@@ -190,8 +191,9 @@ static int pcmda12_attach(struct comedi_device *dev,
 
        devpriv->simultaneous_xfer_mode = it->options[1];
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        s = dev->subdevices;
        s->private = NULL;
index 31053034b0736533fb8312937f8a4032663ca18a..0e64d848a2a887956532f9cfc7ed1488a58dd615 100644 (file)
@@ -1020,6 +1020,7 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
            thisasic_chanct = 0;
        unsigned long iobase;
        unsigned int irq[MAX_ASICS];
+       int ret;
 
        iobase = it->options[0];
        irq[0] = it->options[1];
@@ -1072,8 +1073,9 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                return -ENOMEM;
        }
 
-       if (comedi_alloc_subdevices(dev, n_subdevs) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, n_subdevs);
+       if (ret)
+               return ret;
 
        /* First, AI */
        sdev_no = 0;
index 33ab4c63b3dca7a5a0e8c23a81ad926ae1b04337..48565fe9efccae0f6f6b6a77ddf45005b70dbe4a 100644 (file)
@@ -754,6 +754,7 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        int sdev_no, chans_left, n_subdevs, port, asic, thisasic_chanct = 0;
        unsigned long iobase;
        unsigned int irq[MAX_ASICS];
+       int ret;
 
        iobase = it->options[0];
        irq[0] = it->options[1];
@@ -801,8 +802,9 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
                return -ENOMEM;
        }
 
-       if (comedi_alloc_subdevices(dev, n_subdevs) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, n_subdevs);
+       if (ret)
+               return ret;
 
        port = 0;
        asic = 0;
index 1e954f9c41655edb8a29bb8a5556aea82c8a4b4f..a129ccace93d187411167bd48e2a7728db19d7f1 100644 (file)
@@ -139,6 +139,7 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct comedi_subdevice *s;
        unsigned long iobase;
        unsigned int iosize;
+       int ret;
 
        iobase = it->options[0];
        printk(KERN_INFO "comedi%d: poc: using %s iobase 0x%lx\n", dev->minor,
@@ -160,8 +161,10 @@ static int poc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        }
        dev->iobase = iobase;
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
+
        if (alloc_private(dev, sizeof(unsigned int) * board->n_chan) < 0)
                return -ENOMEM;
 
index 38a13ba38e18545e52a97c850aaa87a3668ed3a0..a029147c9b69d3de70207637c35e79c0b600a44d 100644 (file)
@@ -872,7 +872,7 @@ static int daqp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->iobase = local->link->resource[0]->start;
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        printk(KERN_INFO "comedi%d: attaching daqp%d (io 0x%04lx)\n",
index 445333b2413eb96b6c50758f7d60281cfdac0331..c3c8097acd0262a534c4599d51eb92a685dd9558 100644 (file)
@@ -1999,9 +1999,9 @@ static int rtd_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        /* Show board configuration */
        printk(KERN_INFO "%s:", dev->board_name);
 
-       if (comedi_alloc_subdevices(dev, 4) < 0)
-               return -ENOMEM;
-
+       ret = comedi_alloc_subdevices(dev, 4);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        dev->read_subdev = s;
index a80f6302375b5eb6c5819341ee4a214d63873198..966ac2ccc87728375f5c68877dd4eeaf552890a6 100644 (file)
@@ -349,7 +349,7 @@ static int rti800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->board_name = board->name;
 
        ret = comedi_alloc_subdevices(dev, 4);
-       if (ret < 0)
+       if (ret)
                return ret;
 
        ret = alloc_private(dev, sizeof(struct rti800_private));
index 1aacf3f6e3f5ddb291602e88eda4be8b9de91d80..fc16508181d4bcb62c7517ea1cfb0093303e019d 100644 (file)
@@ -92,6 +92,7 @@ static int rti802_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct comedi_subdevice *s;
        int i;
        unsigned long iobase;
+       int ret;
 
        iobase = it->options[0];
        printk(KERN_INFO "comedi%d: rti802: 0x%04lx ", dev->minor, iobase);
@@ -103,10 +104,12 @@ static int rti802_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
        dev->board_name = "rti802";
 
-       if (comedi_alloc_subdevices(dev, 1) < 0
-           || alloc_private(dev, sizeof(struct rti802_private))) {
+       if (alloc_private(dev, sizeof(struct rti802_private)))
                return -ENOMEM;
-       }
+
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        s = dev->subdevices;
        /* ao subdevice */
index 6a30537987c6be903e39bde6d056f103405d0c8e..141bc9e881c9816e06a73a79b886b838cbb1e83b 100644 (file)
@@ -743,6 +743,7 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        struct comedi_subdevice *s;
        int iobase;
        int i, n;
+       int ret;
 /* short value; */
 /* int subdev_channel = 0; */
        union cmReg cmReg;
@@ -774,8 +775,9 @@ static int s526_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (alloc_private(dev, sizeof(struct s526_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;
        /* GENERAL-PURPOSE COUNTER/TIME (GPCT) */
index f2eeca51ebfae4f6df40df7086caaa2e839e4e6a..32e03bc247b3cabd3f453ee9f4396554e7223ab9 100644 (file)
@@ -595,8 +595,9 @@ static int s626_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        dev->board_ptr = s626_boards;
        dev->board_name = thisboard->name;
 
-       if (comedi_alloc_subdevices(dev, 6) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 6);
+       if (ret)
+               return ret;
 
        dev->iobase = (unsigned long)devpriv->base_addr;
        dev->irq = devpriv->pdev->irq;
index dc41c04fae4fdf21386be40d7cd9ce7df9e70252..e622973807863acdcec19e6b2a84556c6f79df57 100644 (file)
@@ -780,6 +780,7 @@ static int serial2002_attach(struct comedi_device *dev,
 {
        const struct serial2002_board *board = comedi_board(dev);
        struct comedi_subdevice *s;
+       int ret;
 
        dev_dbg(dev->hw_dev, "comedi%d: attached\n", dev->minor);
        dev->board_name = board->name;
@@ -792,8 +793,9 @@ static int serial2002_attach(struct comedi_device *dev,
        dev_dbg(dev->hw_dev, "/dev/ttyS%d @ %d\n", devpriv->port,
                devpriv->speed);
 
-       if (comedi_alloc_subdevices(dev, 5) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 5);
+       if (ret)
+               return ret;
 
        /* digital input subdevice */
        s = dev->subdevices + 0;
index ca10b1a981532904b0e5721306bcfbfc68eb3cfc..92d44c1d258741369613b4cb4a3a550ef9e068a2 100644 (file)
@@ -210,6 +210,7 @@ static int skel_ns_to_timer(unsigned int *ns, int round);
 static int skel_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        struct comedi_subdevice *s;
+       int ret;
 
        pr_info("comedi%d: skel: ", dev->minor);
 
@@ -233,8 +234,9 @@ static int skel_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (alloc_private(dev, sizeof(struct skel_private)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 3) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 3);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* dev->read_subdev=s; */
index 130e4bd5c640aa39301dbd2bf703c781a91d6a74..b12bafe9baf6485a5cfbe64ca821daca68127831 100644 (file)
@@ -187,6 +187,7 @@ static int dnp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
        const struct dnp_board *board = comedi_board(dev);
        struct comedi_subdevice *s;
+       int ret;
 
        printk(KERN_INFO "comedi%d: dnp: ", dev->minor);
 
@@ -197,8 +198,9 @@ static int dnp_attach(struct comedi_device *dev, struct comedi_devconfig *it)
        if (alloc_private(dev, sizeof(struct dnp_private_data)) < 0)
                return -ENOMEM;
 
-       if (comedi_alloc_subdevices(dev, 1) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, 1);
+       if (ret)
+               return ret;
 
        s = dev->subdevices + 0;
        /* digital i/o subdevice                                             */
index 711dad77c59880438554d8a2c545e54e55d43d23..9f1fdec62dcbbc1a10bf56e8df579d2c845d4116 100644 (file)
@@ -443,6 +443,7 @@ static int unioxx5_attach(struct comedi_device *dev,
 {
        int iobase, i, n_subd;
        int id, num, ba;
+       int ret;
 
        iobase = it->options[0];
 
@@ -468,8 +469,9 @@ static int unioxx5_attach(struct comedi_device *dev,
                return -1;
        }
 
-       if (comedi_alloc_subdevices(dev, n_subd) < 0)
-               return -ENOMEM;
+       ret = comedi_alloc_subdevices(dev, n_subd);
+       if (ret)
+               return ret;
 
        /* initializing each of for same subdevices */
        for (i = 0; i < n_subd; i++, iobase += UNIOXX5_SUBDEV_ODDS) {
index a6cf13459c6193615e673781fc7e533dedb2153a..0386fd4a80bad072ecdaebc3e124972565a1e373 100644 (file)
@@ -2646,7 +2646,7 @@ static int usbdux_attach_common(struct comedi_device *dev,
        }
 
        ret = comedi_alloc_subdevices(dev, n_subdevs);
-       if (ret < 0) {
+       if (ret) {
                up(&udev->sem);
                return ret;
        }
index f7d4f56c1688635dffda2b7df0b97debeac834b0..2ee9ecd33539f1db7d3f36fb01fdcbaa24fa942f 100644 (file)
@@ -1667,7 +1667,7 @@ static int usbduxfast_attach(struct comedi_device *dev,
        dev->board_name = BOARDNAME;
 
        ret = comedi_alloc_subdevices(dev, 1);
-       if (ret < 0) {
+       if (ret) {
                up(&(usbduxfastsub[index].sem));
                up(&start_stop_sem);
                return ret;
index f23fad957e5e7cb6503ecbd3801d572188fc712a..502a40948ebd46b732ab1a0929a13338179397cd 100644 (file)
@@ -2691,7 +2691,7 @@ static int usbduxsigma_attach(struct comedi_device *dev,
        }
 
        ret = comedi_alloc_subdevices(dev, n_subdevs);
-       if (ret < 0) {
+       if (ret) {
                up(&udev->sem);
                up(&start_stop_sem);
                return ret;
index 5a3e33d83c843972cf558f8db790c08840f563f5..69402dade14bf991e279fb7390fc33e2047da3dd 100644 (file)
@@ -1135,6 +1135,7 @@ static int vmk80xx_attach(struct comedi_device *cdev,
        int n_subd;
        struct comedi_subdevice *s;
        int minor;
+       int ret;
 
        mutex_lock(&glb_mutex);
 
@@ -1159,10 +1160,11 @@ static int vmk80xx_attach(struct comedi_device *cdev,
        else
                n_subd = 6;
 
-       if (comedi_alloc_subdevices(cdev, n_subd) < 0) {
+       ret = comedi_alloc_subdevices(cdev, n_subd);
+       if (ret) {
                up(&dev->limit_sem);
                mutex_unlock(&glb_mutex);
-               return -ENOMEM;
+               return ret;
        }
 
        /* Analog input subdevice */